-
创建架构
CREATE SCHEMA [Test]
-
修改表架构名
ALTER SCHEMA dbo TRANSFER ERP.User --此处“dbo”为新架构,“ERP”为旧架构,“User”为表名
-
通过sql批量修改表架构名
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='dbo.' + @name--输入新的架构名 print 'ALTER SCHEMA CRM TRANSFER ' + @name--此处“CRM”为旧的架构名 fetch next from csr into @name END CLOSE csr DEALLOCATE csr
网友评论