码迷,mamicode.com
首页 > 数据库 > 详细

SQL 修改数据库架构名

时间:2015-01-16 18:43:23      阅读:302      评论:0      收藏:0      [点我收藏+]

标签:

SQl 修改数据库架构名

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=‘cqgcfccn.‘ + @name
print ‘ALTER SCHEMA dbo TRANSFER ‘ + @name
fetch next from csr1 into @name END
CLOSE csr1
declare csr1 cursor
for
select * from INFORMATION_SCHEMA.VIEWs
open csr1 FETCH NEXT FROM csr1 INTO @name
while (@@FETCH_STATUS=0) BEGIN SET
@name=‘cqgcfccn.‘ + @name print ‘ALTER SCHEMA dbo TRANSFER ‘ +
@name fetch next from csr1 into @name END CLOSE csr1 修改数据库架构名

SQL 修改数据库架构名

标签:

原文地址:http://www.cnblogs.com/yangdunqin/p/4229406.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!