如何使用sp_rename重命名包含点字符的表名 [英] How to rename table name which contain dot character using sp_rename
本文介绍了如何使用sp_rename重命名包含点字符的表名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我尝试重命名包含。的表名。在sql server中使用sp_rename,
例如:
Hi
I try to rename table name which contain "." using sp_rename in sql server,
E.g:
sp_rename N'1043_MMM.LKJ', N'1043_MMMLKJ'
i会收到这样的错误
i will get error like this
Msg 15225, Level 11, State 1, Procedure sp_rename, Line 374
No item by the name of '[1043_MMM.LKJ]' could be found in the current database 'master', given that @itemtype was input as '(null)'.
如何解决t他的?
我不能再次删除并创建表,bcz它包含值,所以我只想重命名。
任何特殊字符都有限制在sql server中创建表?如果得到请给出信息。
手动可以重命名表
问候
Aravind
我的尝试:
如果我在sql server中的master数据库也是同样的错误。
How to solve this ?
I cant Drop and create table again,bcz it contains value,so i want rename only.
Any special character got restriction for creating table in sql server ? if got pls give information.
Manually can rename table
Regards
Aravind
What I have tried:
if i run in master database in sql server also same error.
推荐答案
如果你的表名包含标识符,如果要重命名它,你应该运行用双引号包装tablename ()并使用sp_rename命令。
试试这个:
sp_rename N'1043_MMM。 LKJ',N'1043_MMMLKJ'
If your table name contains identifier, and if you want to rename it, you should run wrap the tablename with double quotes (") and use the sp_rename command.
Try this:
sp_rename N'"1043_MMM.LKJ"', N'1043_MMMLKJ'
这篇关于如何使用sp_rename重命名包含点字符的表名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文