SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


query to change the field identity,Identity seed,Identity Increment


query to change the field identity,Identity seed,Identity Increment

Author
Message
vamshi.sql
vamshi.sql
SSC Veteran
SSC Veteran (252 reputation)SSC Veteran (252 reputation)SSC Veteran (252 reputation)SSC Veteran (252 reputation)SSC Veteran (252 reputation)SSC Veteran (252 reputation)SSC Veteran (252 reputation)SSC Veteran (252 reputation)

Group: General Forum Members
Points: 252 Visits: 247
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.
jeff.mason
jeff.mason
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2697 Visits: 2137
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search