Monday, March 12, 2012

primary key

What is the easiest way of finding out the primary key on a SQL 2000 table?
One method:
EXEC sp_help 'MyTable'
Hope this helps.
Dan Guzman
SQL Server MVP
"jonjo" <jonjo@.discussions.microsoft.com> wrote in message
news:C699DB25-3813-4B91-A7BE-D31AE16DEA15@.microsoft.com...
> What is the easiest way of finding out the primary key on a SQL 2000
> table?
|||Well, there are lot's of ways. I'm not sure which one is easiest. A few
options include:
* from Enterprise Manager... right click on the table, select design, and
look for the columns that have a yellow key symbol next to them
* from Query Analyzer... sp_help tablename will show you a lot of info
including all the constraints.
* there are lots of ways to figure it out by querying system tables but the
above approaches are 'easier'
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"jonjo" <jonjo@.discussions.microsoft.com> wrote in message
news:C699DB25-3813-4B91-A7BE-D31AE16DEA15@.microsoft.com...
> What is the easiest way of finding out the primary key on a SQL 2000
table?
|||Hi,
For Enterprise manager, select the table and rigth button and clic in Design
Table and see the Keys....
or
for Query Analyzer, Find the Database in the Object Browser, Select USER
TABLES and find the table, double clic and select CONSTRAINTS....
Hermilson Tinoco.
MCDBA, MCSD
"jonjo" wrote:

> What is the easiest way of finding out the primary key on a SQL 2000 table?
|||>> What is the easiest way of finding out the primary key on a SQL 2000[vbcol=seagreen]
sp_pkeys
Anith

No comments:

Post a Comment