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 |
|
d3ng
Yak Posting Veteran
83 Posts |
Posted - 2009-01-29 : 22:18:37
|
| Hi SQL experts,I would like to ask for a SQL script on setting the IDENTIFY SPECIFICATION to YES and the identity increment = 1 and identity seed = 1. Thanks in advance |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-01-29 : 23:24:17
|
| You have to do that through Management Studio. |
 |
|
|
raky
Aged Yak Warrior
767 Posts |
Posted - 2009-01-29 : 23:35:13
|
| Hi,Just drop the id column which is already existing and add a new column with same name id with identity property For ex: create table temp1 ( id int, name varchar(50))insert into temp1select 1, 'abc' union allselect 3,'dsd'select * from temp1alter table temp1 drop column idalter table temp1 add id int identity(1,1) |
 |
|
|
d3ng
Yak Posting Veteran
83 Posts |
Posted - 2009-01-30 : 01:10:33
|
| Thanks. I just addedd some checking before executing the drop. |
 |
|
|
raky
Aged Yak Warrior
767 Posts |
Posted - 2009-01-30 : 01:17:55
|
| Welcome... |
 |
|
|
|
|
|