创建新表时如何更改 SQL Server 2008 中的默认列定义?
在 SSMS 中创建新表时 - 右键单击“表”节点,选择“新建表...” - 新列的默认定义是 nchar(10)。
我可以改变这一点吗?假设每当有人创建新表时,我希望默认列定义为 varchar(5)。
我找不到任何类型的选项来更改它,我想这可能是注册表设置?
When creating a new table in SSMS - right click on the "Tables" node, choose "New Table..." - the default definition for a new column is nchar(10).
Can I change that? Let's say I would like the default column definition to be varchar(5) whenever someone creates a new table.
I can't find any sort of option to change that, I'm thinking maybe it's a registry setting?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在注册表中:
另请查看 SSVDefault*Length(例如 SSVDefaultCharLength)以设置长度。
有关更改注册表的所有注意事项均适用。
In the Registry:
Also look at SSVDefault*Length (e.g. SSVDefaultCharLength) to set the length.
All caveats about changing the registry apply.
谢谢你。一件小事:当安装了多个安装/版本的 SSMS 时,有必要确保更改正确的密钥版本。
看起来很明显,但我被抓住了。
Thanks for that. One small thing: when there have been multiple installationss/ versions of SSMS installed, it's necessary to ensure that they right versions of the keys are changed.
Seems obvious, but I got caught out.
你不能。实际上,你可以:参见 Darryl Peterson 的回答说实话,在查询窗口中使用 CREATE TABLE 并手动键入会更快。你很快就能掌握语法。
首先,您可以查看 View..Template Explorer。有一个“创建表”模板。
You can't.Actually, you can: see Darryl Peterson's answerTo be honest, you're quicker to use CREATE TABLE in a query windows and type it all manually. You pick the syntax up quick enough.
To start, you could look at View..Template Explorer. There is a "Create Table" template.