declare @name sysname
declare csr cursor
for select TABLE_NAME from INFORMATION_SCHEMA.TABLES where table_schema='旧Schema名称'
open csr
FETCH NEXT FROM csr INTO @name
while (@@FETCH_STATUS=0)
BEGIN
SET @name='旧schema名称.' + @name
print 'ALTER SCHEMA 新Schema名称 TRANSFER ' + @name
fetch next from csr into @name
END
CLOSE csr
DEALLOCATE csr
【批量修改 sql schema】