sunny.tjk
SSCertifiable
Points: 5041
More actions
August 22, 2011 at 10:25 am
#246570
Just curious if anyone has a query to list all the primary and unique keys in a SQL server 2000 database?
Thanks.
Ninja's_RGR'us
SSC Guru
Points: 294069
August 22, 2011 at 10:29 am
#1371549
SELECT * FROM dbo.sysobjects WHERE XType IN ('PK', 'UQ')
Please note that there's a difference between unique constraint and unique index. UI won't be in the objects table.
Re-edit 18K 🙂
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply