From 53f22eec12962373b036c1111ca0f7c8ea2cf4ff Mon Sep 17 00:00:00 2001 From: Brad Allen Date: Thu, 18 Mar 2010 11:47:45 -0600 Subject: [PATCH] Hardcoded ident_seed and ident_increment query had bind markers noncompliant with SQL-92, which caused mxODBC failures. This was corrected by using string substitution in building the statement, and removing the bind params. --- lib/sqlalchemy/dialects/mssql/base.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py index 6425291c8a..e6e9a0e41b 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -1326,12 +1326,10 @@ class MSDialect(default.DefaultDialect): if ic is not None and self.server_version_info >= MS_2005_VERSION: table_fullname = "%s.%s" % (current_schema, tablename) cursor = connection.execute( - sql.text("select ident_seed(:tname), ident_incr(:tname)", - bindparams=[ - sql.bindparam('tname', table_fullname) - ] + "select ident_seed('%s'), ident_incr('%s')" + % (tablename, tablename) ) - ) + row = cursor.first() if not row is None: colmap[ic]['sequence'].update({ -- 2.47.3