ms-sql fails during reflection
Issue #901
resolved
sp_columns is called during reflection of tables... right now it's called with the schema prepended, like 'dbo.mytable'. this is incorrect syntax (on 2005 at least). i've attached a patch which lets it work.
HTH, --craig
Index: lib/sqlalchemy/databases/mssql.py
===================================================================
--- lib/sqlalchemy/databases/mssql.py (revision 3933)
+++ lib/sqlalchemy/databases/mssql.py (working copy)
@@ -605,7 +605,10 @@
raise exceptions.NoSuchTableError(table.name)
# We also run an sp_columns to check for identity columns:
- cursor = connection.execute("sp_columns %s" % self.identifier_preparer.format_table(table))
+ cursor = connection.execute(
+ "sp_columns @table_name = '%s', @table_owner = '%s'"
+ % (table.name, current_schema))
+
ic = None
while True:
row = cursor.fetchone()
Comments (4)
-
Account Deleted -
repo owner -
Account Deleted - changed status to resolved
(original author: ram) 116e19f7f0c9a7c50ea52825a70ac00a83e95fa8, thanks for the patch
-
repo owner - removed milestone
Removing milestone: 0.4.xx (automated comment)
- Log in to comment
whoops... wiki didn't like the patch. attached.