summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordonkopotamus <derek.harland@finq.co.nz>2013-12-05 16:49:13 +1300
committerMike Bayer <mike_mp@zzzcomputing.com>2013-12-05 18:37:50 -0500
commit2f18f9b2f5f354421986d5e16793ca663d1fb14c (patch)
tree224c611823c056d2d466eaffcae9ab2bea9922dd
parent2b3073c76bfa55f0905b50638b096ca0b4890feb (diff)
downloadsqlalchemy-2f18f9b2f5f354421986d5e16793ca663d1fb14c.tar.gz
Fix MSSQL dialects visit_drop_index to use the correct DDL
-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 fa6db3453..fb405bfeb 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