Pull requests

#7 Merged
Repository
Deleted repository
Branch
patch-mssql-drop-index (b18440c83265)
Repository
zzzeek/sqlalchemy sqlalchemy
Branch
master

Fix MSSQL dialects visit_drop_index to use the correct DDL

Author
  1. Derek Harland
Reviewers
Description

Corrects the MSSQL dialect to generate a drop index as

DROP INDEX <index> on <schema>.<table>

Comments (4)

  1. Derek Harland author

    Here is the reference for DROP INDEX. It notes support for the syntax DROP INDEX <schema>.<table>.<idx_name> but says that it should be considered deprecated.

    I made this change because SQL generated by alembic wasn't working, but on reflection I see the problem was something else … the existing code actually generates a statement of the form

    DROP INDEX <table>.<schema>.<idx_name>
    

    i.e. The schema portion is in the wrong place

    Given this, what is the preferred fix?

    • to generate DROP INDEX <schema>.<table>.<idx_name>, which will work but is considered deprecated; or

    • to generate DROP INDEX <idx_name> ON <schema>.<table> which is MSSQL's blessed syntax?