Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select columnName for index???
Message
From
01/12/2005 10:00:19
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Select columnName for index???
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01073696
Message ID:
01073696
Views:
51
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.
Next
Reply
Map
View

Click here to load this message in the networking platform