注册 登录
编程论坛 SQL Server论坛

[求助] 批量修改字段名称

fqbnet2008 发布于 2007-04-16 10:58, 689 次点击
我的数据库名称是 ss

里面有30多张表,都是以BL_开头的,里面都只有一个字段 :名称

我想把这些表的列名全改成 name

我该怎么办呀,?????

如何写一个批处理来完成????
4 回复
#2
棉花糖ONE2007-04-16 11:09


exec sp_configure 'allow update',1
reconfigure with override
update syscolumns set name='name' from sysobjects where syscolumns.id in (select id from sysobjects where name like 'bl_%')
exec sp_configure 'allow update',0
reconfigure with override

#3
fqbnet20082007-04-16 12:53
exec sp_configure 'allow update',0
reconfigure with override 这是什么意思呀???

是干什么用的呀
#4
棉花糖ONE2007-04-16 15:03
结果达到了没啊
#5
帅哥一条虫2007-04-16 15:57
exec sp_configure 'allow update',0----------禁止对系统表进行更新,
reconfigure with override ---------语句强制实施该配置
1