--批量修改架构。名称为XJADMINATT的所有表修改为dbo-- --把执行的结果,拷贝到命令行,执行命令即可-- declare @name sysname declare csr1 cursor for select TABLE_NAME from INFORMATION_SCHEMA.TABLES open csr1 FETCH NEXT FROM csr1 INTO @name while (@@FETCH_STATUS=0) BEGIN SET @name=‘XJADMINATT.‘ + @name print ‘ALTER SCHEMA dbo TRANSFER ‘ + @name fetch next from csr1 into @name END CLOSE csr1
时间: 2024-10-31 12:17:11