如何把某个数据库的所有表名,字段都改为小写
--允许系统表更新
exec sp_configure allow updates,1
go
reconfigure with override
go
--更新系统表
update sysobjects
set name=lower(name)
where xtype=U
update syscolumns
set name=lower(A.name)
from syscolumns A
join sysobjects B on A.ID=B.ID and B.xtype=U
--还原默认设置
exec sp_configure allow updates,0
go
reconfigure with override
go