|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, December 02, 2009 12:19 AM
Points: 108,
Visits: 248
|
|
hi
help me..
how to alter primary key int datatype to uniqueidentifier
Thanks Dastagiri.D
|
|
|
|
|
SSCoach
         
Group: General Forum Members
Last Login: Monday, May 06, 2013 1:09 PM
Points: 15,439,
Visits: 9,569
|
|
Drop the PK constraint.
Add the UID column, add a PK constraint to that.
Drop the old ID column.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, December 02, 2009 12:19 AM
Points: 108,
Visits: 248
|
|
hi..
any code.
i need t-sql query for alter int to uniqueidentifier
Thanks Dastagiri.D
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 11:21 AM
Points: 37,686,
Visits: 29,943
|
|
Look up ALTER TABLE in books online (web version: http://msdn.microsoft.com/en-us/library/ms190273%28SQL.90%29.aspx)
ALTER TABLE ... DROP CONSTRAINT ... to remove the pk ALTER TABLE ... ADD ... to add a new column ALTER TABLE ... DROP ... to drop the old column ALTER TABLE ... ADD CONSTRAINT ... to replace the pk constraint.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|