通过一个错误重置sql中的身份字段
如何将数据库表中的标识字段重置为“0”值?
我使用了这个脚本:
DBCC CHECKIDENT({table name}, reseed, 0)
但是这个消息有一个错误:
CHECKIDENT 附近的语法不正确
什么是 CHECKIDENT?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道你在做什么 - 但这对我来说完美效果很好:
结果是:
您需要确保将表名放入单引号中:使用
'EMP'
- 而不是EMP
CHECKIDENT
(来自:检查身份)只是 SQL Server 中DBCC
函数的命令名称(还有更多可用的DBCC.......
命令)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'
- notEMP
CHECKIDENT
(from: check identity) is just the name of the command for theDBCC
function in SQL Server (there are a lot moreDBCC.......
commands available)试试这个:
Try this: