From b18440c8326539582153f4dbb4a3b09f29535712 Mon Sep 17 00:00:00 2001 From: donkopotamus Date: Thu, 5 Dec 2013 16:49:13 +1300 Subject: [PATCH] Fix MSSQL dialects visit_drop_index to use the correct DDL --- 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 06570b032f..c8e0d7dda3 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -1018,13 +1018,11 @@ class MSDDLCompiler(compiler.DDLCompiler): return text def visit_drop_index(self, drop): - return "\nDROP INDEX %s.%s" % ( - self.preparer.quote_identifier(drop.element.table.name), - self._prepared_index_name(drop.element, - include_schema=True) + return "\nDROP INDEX %s ON %s" % ( + self._prepared_index_name(drop.element, include_schema=False), + self.preparer.format_table(drop.element.table) ) - class MSIdentifierPreparer(compiler.IdentifierPreparer): reserved_words = RESERVED_WORDS -- 2.47.3