declare @tablename varchar(100)
declare cursor1 cursor for
select name from sysobjects where xtype = 'u' order by name
open cursor1
fetch next from cursor1 into @tablename
while @@fetch_status=0
begin
set @sql='sp_rename '''+@tablename+''','''+lower(@tablename)+'''' -- 此为修改为大写,如果修改为小写“lower”
--print @sql -- 首先打印出来
exec(@sql)
fetch next from cursor1 into @tablename
end
close cursor1
deallocate cursor1