Skip to content
Advertisement

Issue creating table in MS SQL Database with Python script

The above code successfully connects to the database. The script also returns no errors when run, however when I go to check if the table was created, there are no tables in the SQL DB at all.

Why is no table created and why is no error returned?

Advertisement

Answer

Each user in MS SQL Server has a default schema associated with it. The configuration details depend on the version of SQL server and it is configured in the Enterprise Manager. I don’t think SQL Management studio has GUI visibility into it.
You can try querying for it using:

You can also explicitly create tables in a particular schema by prefixing schema name to the table name, i.e.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement