Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avoiding selection primary key in sysindexes
Message
De
05/03/2008 09:23:53
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01298781
Message ID:
01298875
Vues:
17
>Try
>SELECT name FROM sysindexes
>WHERE id = OBJECT_ID(N'MyTable') AND
>   indid > 0 AND indid < 255 AND
>  INDEXPROPERTY(id, name, 'IsStatistics') = 0
>  AND name <> (SELECT CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
>	WHERE CONSTRAINT_TYPE = 'PRIMARY KEY'
>		AND TABLE_NAME = 'MyTable')
>
Thanks, this works.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform