Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

query to change the field identity,Identity seed,Identity Increment Expand / Collapse
Author
Message
Posted Friday, July 23, 2010 12:40 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, November 21, 2014 3:12 AM
Points: 56, Visits: 194

Hi can anyone of you please let me know the query to change the field identity,Identity seed,Identity Increment..

Details are given below..

Server: USFKL20DB11CI01
Database: FESD
Table: dbo. Usernames
Field: UserID

Plesae ensure that the following settings are in place:
Identity = True
Identity seed = 1
Identity increment = 1


UserID field is a Primary Key..I am unable to edit there in the properties dailog box.So,please let me know the query to change this..

Thanks in Advance..
Vamshi.
Post #958177
Posted Friday, July 23, 2010 12:50 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 8:00 AM
Points: 985, Visits: 1,839
As far as the seed goes, this will report the seed:


DBCC CHECKIDENT ("FESD.dbo. Usernames ", NORESEED);
GO

And this will set the seed to 1:

DBCC CHECKIDENT ("FESD.dbo. Usernames ", RESEED, 1);
GO

However, this will cause errors on later inserts if values greater than 1 exist in the identity and the column is unique in any way.

Not sure about how to do the increment step. You may have to re-create the column or table to change that.
Post #958182
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse