Hello,
I have a legacy database (don't we all) where many tables do not have indexes / key fields. What I have now learned, is that some of the tables have indexes defined, but they are not made into key fields! On these tables, it would help if I could get the name of the field that was set as the index, so I could make it the key field as well.
I can find whether or not a table has an index by:
IF NOT EXISTS (
SELECT IDENT_INCR(TABLE_NAME) AS IDENT_INCR
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = @TableName
)
But this does not give me the name. :P
As always, thanks in advance!
Thank You
Rollin Burr
Politicians and diapers have one thing in common. They should both be changed regularly, and for the same reason.