470,596 Members | 1,117 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,596 developers. It's quick & easy.

find a primary key

japuentem
Hi all

i want to know if i can show with a sql sentence in my query analizer the primary key of one table

i know sp_columns '@table' show me the columns of my table but i want to know if one of the columns are primary key

thanks
Jun 27 '07 #1
2 1408
debasisdas
8,127 Expert 4TB
try executing this

Expand|Select|Wrap|Line Numbers
  1. exec sp_helpconstraint tablename
Jun 28 '07 #2
try executing this

Expand|Select|Wrap|Line Numbers
  1. exec sp_helpconstraint tablename
Thanks, that's what i'm lookinf for
Jun 28 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Scott Adams | last post: by
4 posts views Thread by Marc Pelletier | last post: by
3 posts views Thread by Solel Software | last post: by
3 posts views Thread by Brad | last post: by
3 posts views Thread by rnettle | last post: by
2 posts views Thread by Brad | last post: by
33 posts views Thread by Kevin Brammer | last post: by
1 post views Thread by =?Utf-8?B?Rm9lZg==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.