MS MSQL 2000K error

roxwal's profile image roxwal posted 10 years ago in General Permalink
SELECT C.CONSTRAINT_NAME, C.CONSTRAINT_TYPE, K.COLUMN_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS C
INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS K ON C.CONSTRAINT_NAME = K.CONSTRAINT_NAME AND K.TABLE_NAME='directory' AND TABLE_CATALOG='BTS_DIR'
WHERE C.CONSTRAINT_TYPE IN ('PRIMARY KEY', 'UNIQUE')
ORDER BY K.ORDINAL_POSITION;
/* Errore SQL (209): Ambiguous column name 'TABLE_CATALOG'. */
/* Affected rows: 0 Righe trovate: 0 Avvisi: 0 Durata di 0 of 1 query: 0,000 sec. */

can fix?
can use k.TABLE_CATALOG

TKS
Code modification/commit from ansgar.becker, 10 years ago, revision 4761
Fix missing table alias on MSSQL2K. See http://www.heidisql.com/forum.php?t=15506
ansgar's profile image ansgar posted 10 years ago Permalink
Fixed in r4761

Please login to leave a reply, or register at first.