How can I reset identity field in a table in database by ‘0’ value?
I used of this script:
DBCC CHECKIDENT({table name}, reseed, 0)
But this has a error by this message :
Incorrect syntax near CHECKIDENT
What is CHECKIDENT?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t know what you’re doing – but this works perfectly well for me:
Results in:
You need to make sure to put your table name into single quotes: use
'EMP'– notEMPCHECKIDENT(from: check identity) is just the name of the command for theDBCCfunction in SQL Server (there are a lot moreDBCC.......commands available)