|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Alter a constraint?Is there a way to add a column to a PRIMARY KEY constraint (without
deleting and recreating it?) Thanks. No.
-- Show quoteAdam 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.
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. Rick Charnes (rickxyz--nospam.zyxcharnes@thehartford.com) writes:
> Is there a way to add a column to a PRIMARY KEY constraint (without No, for a pure index it is possible by adding the WITH DROP_EXISTING> deleting and recreating it?) Thanks. 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 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 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? > > 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. 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/ 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/ |
|||||||||||||||||||||||