Thursday, April 30, 2015

Identity colunm things in sql server

1) How to update values in identity column in sql server..?
sol:  You cannot update an IDENTITY column. You need to move the data into another table make the changes over there and insert the back the data into original table.

2) How to see next identity value in sql server through query..?
sol: DBCC Checkident ('TableName')
ex: DBCC Checkident ('EMP')

3) How to reset identity seed value in sql server.?
Sol: DBCC CHECKIDENT ('TableName', RESEED, number)
ex: DBCC Checkident ('EMP',RESEED,11)

No comments:

Post a Comment