社区
MS-SQL Server
帖子详情
如果数据库表名与关键字冲突怎么办?
hellopls
2003-05-06 03:14:07
在sql server2000里的northwind中有表格customer and suppliers by city
如果要对这个表格进行查询,写这样的语句
select * from customer and suppliers by city
是会报错的。
但是怎么样解决了?
...全文
348
14
打赏
收藏
如果数据库表名与关键字冲突怎么办?
在sql server2000里的northwind中有表格customer and suppliers by city 如果要对这个表格进行查询,写这样的语句 select * from customer and suppliers by city 是会报错的。 但是怎么样解决了?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
14 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
hellopls
2003-05-07
打赏
举报
回复
改名字也是个好办法,不过我用的是动态的创建,所以。。。嘿嘿
谢了先
nboys
2003-05-06
打赏
举报
回复
exec master..sp_rename 'customer and suppliers by city','customer'
select * from northwind..customer
hellopls
2003-05-06
打赏
举报
回复
不过该怎么样给分了
后面的都和ldcr520是一样的答案
:(
明天给分
hellopls
2003-05-06
打赏
举报
回复
不过该怎么样给分了
后面的都和ldcr520是一样的答案
:(
明天给分
wbf420
2003-05-06
打赏
举报
回复
努力!朋友!
hellopls
2003-05-06
打赏
举报
回复
这种方法是对的select * from [customer and suppliers by city]
如果要数据库的话,可以是这样
select * from northwind..[customer and suppliers by city]
多谢大家了!!
miller3000
2003-05-06
打赏
举报
回复
select * from [Customer and Suppliers by City]
mjhnet
2003-05-06
打赏
举报
回复
select * from [customer and suppliers by city]
seasong
2003-05-06
打赏
举报
回复
select * from [customer and suppliers by city]
ldcr520
2003-05-06
打赏
举报
回复
select * from "customer and suppliers by city"
ldcr520
2003-05-06
打赏
举报
回复
select * from [customer and suppliers by city]
hellopls
2003-05-06
打赏
举报
回复
customer and suppliers by city是一个表格的名字,不信你可以去看一看
caiyunxia
2003-05-06
打赏
举报
回复
select * from table1,table2 where ...
hellopls
2003-05-06
打赏
举报
回复
在线等待
SQL
数据库
设计命名规范.pdf
不要使用"ID"等与系统保留
关键字
冲突
的单词作为列名。 6. 主键 任何表都必须定义主键。 表主键命名为:"pk+_+
表名
(或缩写)+_+主键标识"。 7. 外键 表外键命名为:"fk+_+
表名
(或缩写)+_主
表名
(或缩写)+_+主键标识...
MYSQL语法与例题.pdf
创建表时要注意不要和
关键字
冲突
。 、把用户定义的内容用反引号引起来。`(Esc按键的下方) 、
数据库
命名习惯:
表名
ORDERS (建议) 实体(记录)完整性 (Entity)。
用sql命令修改数据表中的一个字段为非空(not null)的语句
table1
表名
name 字段名 为什么加上[],因为name是sql
关键字
会
冲突
出现错误,这样以防万一。如果name字段已经创建了索引,如果需要修改的话,必须先删除索引才能正确的进行。 您可能感兴趣的文章:sql server建库...
解决
数据库
处理中
表名
与
关键字
、保留字
冲突
使用``将
表名
包含其起来 如 update order set name = “11” where id = 1; 改成:update `order` set name = “11” where id = 1; 这样就可以解决错误
MySQL
表名
与MySQL
关键字
冲突
导致插入数据BadSqlGrammarException
MySQL
表名
与MySQL
关键字
冲突
Mybatis plus插入数据BadSqlGrammarException
MS-SQL Server
34,594
社区成员
254,589
社区内容
发帖
与我相关
我的任务
MS-SQL Server
MS-SQL Server相关内容讨论专区
复制链接
扫一扫
分享
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章