Skip to content

Commit a47e64d

Browse files
committed
Merge branch 'azure-1.11' into azure-2.0
2 parents 760036b + dfb97d4 commit a47e64d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sql_server/pyodbc/introspection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,9 @@ def get_constraints(self, cursor, table_name):
299299
WHERE
300300
kc.table_schema = SCHEMA_NAME() AND
301301
kc.table_name = %s
302-
ORDER BY kc.ordinal_position ASC
302+
ORDER BY
303+
kc.constraint_name ASC,
304+
kc.ordinal_position ASC
303305
""", [table_name])
304306
for constraint, column, kind, ref_table, ref_column in cursor.fetchall():
305307
# If we're the first column, make the record

0 commit comments

Comments
 (0)