primary key

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aaryan
    New Member
    • Nov 2006
    • 82

    primary key

    hi guys,
    i have a doubt. i have a table t1 with columns say c1 and c2. now i want to make the column c1 as my primary key. how to issue a query to do so in sql server 2000 to get executed in sql query analyzer? every time i do with alter cmds, it shows that the column c1 already exists!!!
  • scripto
    New Member
    • Oct 2006
    • 143

    #2
    you should be using the ALTER TABLE and ALTER COLUMN commands.

    ALTER TABLE MyTable ALTER COLUMN myColumn [int] IDENTITY (1, 1) NOT NULL


    Take a look at Books on Line (BOL) some time.

    Comment

    Working...