Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select columnName for index???
Message
De
01/12/2005 10:00:19
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Select columnName for index???
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01073696
Message ID:
01073696
Vues:
50
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform