Home All Groups Group Topic Archive Search About
Author
13 Jan 2006 4:28 PM
Rick Charnes
Is there a way to add a column to a PRIMARY KEY constraint (without
deleting and recreating it?)  Thanks.

Author
13 Jan 2006 4:34 PM
Adam Machanic
No.

--
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--


Show quote
"Rick Charnes" <rickxyz--nospam.zyxcharnes@thehartford.com> wrote in message
news:MPG.1e319f3d61c2ebb1989918@msnews.microsoft.com...
> Is there a way to add a column to a PRIMARY KEY constraint (without
> deleting and recreating it?)  Thanks.
Author
13 Jan 2006 4:49 PM
Aaron Bertrand [SQL Server MVP]
No, there is no ALTER CONSTRAINT.  You will need to DROP/CREATE.



Show quote
"Rick Charnes" <rickxyz--nospam.zyxcharnes@thehartford.com> wrote in message
news:MPG.1e319f3d61c2ebb1989918@msnews.microsoft.com...
> Is there a way to add a column to a PRIMARY KEY constraint (without
> deleting and recreating it?)  Thanks.
Author
13 Jan 2006 5:56 PM
Erland Sommarskog
Rick Charnes (rickxyz--nospam.zyxcharnes@thehartford.com) writes:
> Is there a way to add a column to a PRIMARY KEY constraint (without
> deleting and recreating it?)  Thanks.

No, for a pure index it is possible by adding the WITH DROP_EXISTING
clause.

If there is a reference to the PK from other tables, it's quite a complex
operation anyway.

--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
13 Jan 2006 6:16 PM
Grant
What is PK?




Show quote
"Erland Sommarskog" <esq***@sommarskog.se> wrote in message
news:Xns974AC0BF1D4DAYazorman@127.0.0.1...
> Rick Charnes (rickxyz--nospam.zyxcharnes@thehartford.com) writes:
>> Is there a way to add a column to a PRIMARY KEY constraint (without
>> deleting and recreating it?)  Thanks.
>
> No, for a pure index it is possible by adding the WITH DROP_EXISTING
> clause.
>
> If there is a reference to the PK from other tables, it's quite a complex
> operation anyway.
>
> --
> Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
13 Jan 2006 7:12 PM
Aaron Bertrand [SQL Server MVP]
Primary Key


Show quote
> What is PK?
Author
13 Jan 2006 7:13 PM
Grant
duh... I should had knew that.

Thanks.


Show quote
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:uBvY3THGGHA.1192@TK2MSFTNGP11.phx.gbl...
> Primary Key
>
>
>> What is PK?
>
>
Author
14 Jan 2006 1:08 PM
ML
Author
18 Jan 2006 3:08 PM
Grant
I used that all the time in a game call Battlefield 2 by EA. Its my best
choice of weapon.


Show quote
"ML" <M*@discussions.microsoft.com> wrote in message
news:7CFE203C-8622-47BE-B144-F1573326C180@microsoft.com...
> Some DBAs prefer this one: http://en.wikipedia.org/wiki/PK_machine_gun
> ;)
>
>
> ML
>
> ---
> http://milambda.blogspot.com/
Author
18 Jan 2006 3:25 PM
ML
The real one is slightly more difficult to handle. :) I prefer the AK. I
guess the US government is now alert to this conversation. ;)


ML

---
http://milambda.blogspot.com/

AddThis Social Bookmark Button