From cc4dcdcc8051fd4303829aa01e6acb6dd0dd2a76 Mon Sep 17 00:00:00 2001 From: Marthinus Bosman <38855581+MarthinusBosman@users.noreply.github.com> Date: Wed, 16 Mar 2022 09:27:08 +0200 Subject: [PATCH] Change get_table_list to get tables in all schemas --- mssql/introspection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mssql/introspection.py b/mssql/introspection.py index 66aefce3..8f4952ab 100644 --- a/mssql/introspection.py +++ b/mssql/introspection.py @@ -66,7 +66,7 @@ def get_table_list(self, cursor): """ Returns a list of table and view names in the current database. """ - sql = f'SELECT TABLE_NAME, TABLE_TYPE FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = {get_schema_name()}' + sql = f'SELECT TABLE_NAME, TABLE_TYPE FROM INFORMATION_SCHEMA.TABLES' cursor.execute(sql) types = {'BASE TABLE': 't', 'VIEW': 'v'} return [TableInfo(row[0], types.get(row[1]))