When I download this example database, AdventureWorksLT2012_Data, and try to access the table_names in sql alchemy, via
from sqlalchemy import create_engine
engine = create_engine("mssql+pyodbc://sa:PASSWORD_HERE@localhost:1433/AdventureWorksLT?driver=FreeTDS")
engine.table_names()
I get ['BuildVersion', 'ErrorLog']. However this is missing tables from the database.
For example, executing this query gives the expected table names...
rs = engine.execute("SELECT name FROM sys.Tables")
[row['name'] for row in rs]
I get
['BuildVersion', 'Address', 'Customer', 'CustomerAddress', 'Product', 'ProductCategory', 'ProductDescription', 'ProductModel', 'ProductModelProductDescription', 'SalesOrderDetail', 'SalesOrderHeader', 'ErrorLog']
Is this a bug, or have I overlooked something? If I create a new database, and tables with identical names as above, then engine.table_names() works as expected.
engine.table_namesmight only look at a particular schema in the db.