use db명
go
declare @sql as nvarchar(100);
declare @tbname as nvarchar(100);
declare c cursor fast_forward for
select [name] from sysobjects where xtype ='u' or xtype ='p' order by name;
open c;
fetch next from c into @tbname;
while @@fetch_status=0
begin
set @sql='alter schema dbo transfer 스키마명.'+@tbname;
exec(@sql);
fetch next from c into @tbname;
end
close c;
deallocate c;
'개발 > MS-SQL' 카테고리의 다른 글
MSSQL 달력 기능 (0) | 2018.02.12 |
---|---|
mssql db복원할때 다른db명으로 생성하기 (0) | 2018.01.03 |
mssql cursor (0) | 2013.06.10 |
mssql 페이징2 (0) | 2013.01.22 |
asp mssql 페이징 (0) | 2013.01.22 |