Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
petek
Posting Yak Master
192 Posts |
Posted - 2008-11-03 : 07:06:13
|
| Hi All,Hi i have a table without a unique row id but i need to add a column in the table and make the row id unique is this possible??Kind RegardsPete. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-03 : 07:08:05
|
| just useALTER TABLE tablenamehere ADD RowID int identity(1,1) |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2008-11-03 : 07:08:49
|
| Sure:ALTER TABLE tablename ADD MyUniqueID int NOT NULL IDENTITY(1, 1)orALTER TABLE tablename ADD MyUniqueID uniqueidentifier NOT NULL DEAFULT(NewID())- Lumbago |
 |
|
|
petek
Posting Yak Master
192 Posts |
Posted - 2008-11-03 : 07:08:56
|
| i tried this update HoldingtableNOMatch1 set ROWID = IDENTITY(1,1)Kind RegardsPete. |
 |
|
|
petek
Posting Yak Master
192 Posts |
Posted - 2008-11-03 : 07:12:51
|
| I got the following errorMsg 102, Level 15, State 1, Line 2Incorrect syntax near 'DEAFULT'.Kind RegardsPete. |
 |
|
|
petek
Posting Yak Master
192 Posts |
Posted - 2008-11-03 : 07:14:49
|
| Thankyou all it worked my bad....Kind RegardsPete. |
 |
|
|
|
|
|