Sql Server 2005 在列名周围加上方括号 [英] Sql Server 2005 Puts square brackets around column name

查看:31
本文介绍了Sql Server 2005 在列名周围加上方括号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将一个数据库从 Sql Server 2000 移到了 Sql Server 2005.在表设计器中,它坚持在名为Content"的列周围放置方括号我在 Sql 的保留字列表中没有看到 Content服务器,所以我不明白为什么要这样做.有什么办法可以预防吗?

I have recently moved a database from Sql Server 2000 to Sql Server 2005. In the table designer, it insists on putting square brackets around a column named "Content" I don't see Content on the list of reserved words for Sql Server, so I don't understand why it is doing this. Is there a way I can prevent it?

推荐答案

问题是字段与表同名.Sql Server 2000 似乎并不关心这种潜在的歧义,但 Sql Server 2005 关心.当我将名为 Content 的字段添加到未命名为 Content 的表时,方括号不会出现.

The problem is that the field has the same name as the table. Sql Server 2000 did not seem to care about this potential ambiguity, but Sql Server 2005 does. When I add a field named Content to a table that is not named Content, the square brackets do not appear.

帕梅拉

这篇关于Sql Server 2005 在列名周围加上方括号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆