原文地址:http://blog.csdn.net/wuxiaokaixinguo/article/details/8523093
SQLServer2008单个修改架构名
格式:ALTER SCHEMA 新构架名 TRANSFER 旧构架名.A000001
列子:ALTER SCHEMA dbo TRANSFER CH330300.A000001
SQLServer2005批量修改构架名
使用游标
第一步:执行下面语句
use Temp
Go
declare @name sysname
declare csr cursor
for select TABLE_NAME from INFORMATION_SCHEMA.TABLES
open csr
FETCH NEXT FROM csr INTO @name
while (@@FETCH_STATUS=0)
BEGIN
SET @name=‘原构架名.‘ + @name
print ‘ALTER SCHEMA 新构架名 TRANSFER ‘ + @name
fetch next from csr into @name
END
CLOSE csr
DEALLOCATE csr
第二步:把第一步执行的结果,拷贝到查询窗口进行执行。
.embody { padding: 10px 10px 10px; margin: 0 -20px; border-bottom: solid 1px #ededed }
.embody_b { margin: 0; padding: 10px 0 }
.embody .embody_t,.embody .embody_c { display: inline-block; margin-right: 10px }
.embody_t { font-size: 12px; color: #999 }
.embody_c { font-size: 12px }
.embody_c img,.embody_c em { display: inline-block; vertical-align: middle }
.embody_c img { width: 30px; height: 30px }
.embody_c em { margin: 0 20px 0 10px; color: #333; font-style: normal }
时间: 2024-10-16 17:29:49