Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add uniqueidentifier field to existing table

Status
Not open for further replies.

Lost500

IS-IT--Management
Mar 10, 2009
110
US
hey guys and gals,

is there a way to add a uniqueidentifier field to an existing table that already has data in it.
 
Something like an identity seed would do the trick.

Code:
ALTER TABLE MyTbl ADD [newcolname] [int] IDENTITY (1, 1) NOT NULL

This should populate what is already there with an ideltity as well so it's up to date. Test first though, then test adding a row after to make sure continuity of the seed is correct as I haven't tested the whole thing.

HTH,

M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top