[quoted text, click to view] >I need to set the primary key on an existing column within a table.
> Can't somehow seem to get the syntax right.
> I had assumed something like:-Alter Table <table name> Add Constraint
> <constraint name> Primary Key <column name> <constraint rule>
Hi CyberDwarf,
I would encourage you to look at the product documentation (called Books
Online) for syntax and examples. It's generally easier than experimenting
:>)
If you're using SQL Server 2000, you can download that latest version of
Books Online from
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx If you're using SQL Server 2005, you can download that latest version of
Books Online from
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx. --
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of Books Online from
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx [quoted text, click to view] "CyberDwarf" <sdi@lineone.net> wrote in message
news:OStVDpcVHHA.1552@TK2MSFTNGP05.phx.gbl...
>I need to set the primary key on an existing column within a table.
> Can't somehow seem to get the syntax right.
> I had assumed something like:- Alter Table <table name> Add Constraint
> <constraint name> Primary Key <column name> <constraint rule>
>
> but this don't work !!
>
> Any help greatly appreciated
>
> TIA
>
> Steve
>