find a primary key

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • japuentem
    New Member
    • Jun 2007
    • 31

    find a primary key

    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
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    try executing this

    [CODE=sql]exec sp_helpconstrai nt tablename[/CODE]

    Comment

    • japuentem
      New Member
      • Jun 2007
      • 31

      #3
      Originally posted by debasisdas
      try executing this

      [CODE=sql]exec sp_helpconstrai nt tablename[/CODE]
      Thanks, that's what i'm lookinf for

      Comment

      Working...