Is there a way to add a column to a PRIMARY KEY constraint (without
deleting and recreating it?) Thanks.No.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"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.|||No, there is no ALTER CONSTRAINT. You will need to DROP/CREATE.
"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.|||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, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||What is PK?
"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns974AC0BF1D4DAYazorman@.127.0.0.1...
> Rick Charnes (rickxyz--nospam.zyxcharnes@.thehartford.com) writes:
> 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, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx|||Primary Key
> What is PK?|||duh... I should had knew that.
Thanks.
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uBvY3THGGHA.1192@.TK2MSFTNGP11.phx.gbl...
> Primary Key
>
>|||Some DBAs prefer this one: http://en.wikipedia.org/wiki/PK_machine_gun
;)
ML
http://milambda.blogspot.com/|||I used that all the time in a game call Battlefield 2 by EA. Its my best
choice of weapon.
"ML" <ML@.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/|||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/
Saturday, February 25, 2012
Alter a constraint?
Labels:
alter,
column,
constraint,
database,
key,
microsoft,
mysql,
oracle,
primary,
recreating,
server,
sql,
withoutdeleting
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment