1. Mike Bayer
  2. sqlalchemy

Commits

Derek Harland  committed b18440c

Fix MSSQL dialects visit_drop_index to use the correct DDL

  • Participants
  • Parent commits bddf55f
  • Branches master

Comments (0)

Files changed (1)

File lib/sqlalchemy/dialects/mssql/base.py

View file
  • Ignore whitespace
         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