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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 RESETTING SEED VALUE

Author  Topic 

nishita_s
Yak Posting Veteran

61 Posts

Posted - 2009-02-26 : 00:37:28
hi all,
I m trying to reset seed value.
I did following

CREATE TABLE MyCustomers (CustID INTEGER IDENTITY (100,1) PRIMARY KEY, CompanyName NvarChar (50));

INSERT INTO MyCustomers (CompanyName) VALUES ('A. Datum Corporation');

ALTER TABLE MyCustomers
ALTER COLUMN CustId IDENTITY(200, 2)
but this isnt working.
Pls help.
Thanks in advance.

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-02-26 : 00:56:30
use this
dbcc checkident('mycustomers',reseed,200)
INSERT INTO MyCustomers (CompanyName) VALUES ('A. Datum Corporation');
Go to Top of Page

nishita_s
Yak Posting Veteran

61 Posts

Posted - 2009-02-26 : 02:14:43
thank u very much bklr
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-02-26 : 02:21:35
welcome
Go to Top of Page
   

- Advertisement -