原文地址:http://blog.csdn.net/wuxiaokaixinguo/article/details/8523093 ) BEGIN SET @name='原构架名.' + @name print 'ALTER SCHEMA 新构架名 TRANSFER ' + @name fetch next from csr into @name END CLOSE csr DEALLOCATE csr 第二步:把第一步执行的结果,拷贝到查询窗口进行执行. .embody { padding:…
SELECT NAME FROM SYS. ALL_OBJECTS WHERE TYPE= 'U' ORDER BY MODIFY_DATE DESC --查询所有表名 SELECT NAME FROM SYS. ALL_OBJECTS WHERE TYPE= 'U' AND name LIKE '%\_0%' escape '\' AND name NOT LIKE '%_OLD' ORDER BY MODIFY_DATE DESC DECLARE @COUNT INT ) ) )…