summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBrad Allen <bradallen137@gmail.com>2010-03-18 11:47:45 -0600
committerBrad Allen <bradallen137@gmail.com>2010-03-18 11:47:45 -0600
commit53f22eec12962373b036c1111ca0f7c8ea2cf4ff (patch)
tree1590d1fa0ac8534f96bb47ea1c351f4cf8231329 /lib
parente9df4ff45a0b494fa8ab8a4232ea770603439636 (diff)
downloadsqlalchemy-53f22eec12962373b036c1111ca0f7c8ea2cf4ff.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/dialects/mssql/base.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py
index 6425291c8..e6e9a0e41 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({