简体   繁体   English

在SQL Server 2012中设置自动增量

[英]Setting Autoincrement in SQL Server 2012

I was in my designer trying to enable the auto increment and when trying to save the changes this error shows, I am using SQL Server 2012 Management Studio. 我在设计器中尝试启用自动增量,并且在尝试保存此错误显示的更改时,我正在使用SQL Server 2012 Management Studio。

在此处输入图片说明

Does anyone know why? 有人知道为什么吗? Thank You. 谢谢。

This is a feature in Management Studio that prevents you from accidentally dropping and re-creating a table without knowing it. 这是Management Studio中的一项功能,可防止您不知不觉地意外删除和重新创建表。 You can turn this off in Tools -> Options -> Designers -> "Table and Database Designers" - Option is "Prevent saving changes that require table re-creation". 您可以在工具->选项->设计器->“表和数据库设计器”中将其关闭-选项为“防止保存需要重新创建表的更改”。

You should turn this off with caution as this feature is trying to help prevent you from causing issues. 您应谨慎关闭此功能,因为此功能正试图帮助您避免引起问题。 I recommend you only do this against development servers, or even better always just generate the script and execute that instead. 我建议您仅对开发服务器执行此操作,或者最好只生成脚本并执行该脚本。 This way you will always know what commands are being executed. 这样,您将始终知道正在执行哪些命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM