欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

visual studio 修改表名 有大用 有大大用

我的方法

1)

image.png

2)

image.png




在Visual Studio的Server Explorer中怎样修改表名

VS里边好像忘了加这个功能了,可是总会有表名写错的时候,总不能老跑到SQL Server Management Studio里边。其实直接用SQL语句就能解决。

 

1. 在Server Explorer里边右键点击要改变的表名(其实任何一个表都行)

2. 选择New Query, 在弹出的“Add Table”中什么表都不用选,直接 Close

3. 在写着SELECT FROM的框里边写:

exec sp_rename oldname, newname

其中oldname/newname就是新旧表名,注意中间有个不可理喻的“,”,可能用SQL太少的原因吧。

4. 执行(Ctrl+R),会报错,不理他选“continue”

5. 成功

来自  https://www.cnblogs.com/dairongle/archive/2011/05/31/2401252.html

https://blog.csdn.net/diaogan4202/article/details/102165753 

https://blog.csdn.net/weixin_33889665/article/details/89897083 

普通分类: