Created
November 1, 2020 12:28
-
-
Save ssougnez/086281ecb728e1c7ac7c4cc4fe996dff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @sql NVARCHAR(MAX); | |
SET @sql = N''; | |
SELECT @sql = @sql + N' | |
ALTER SCHEMA dbo TRANSFER ' + QUOTENAME(s.Name) + '.' + QUOTENAME(o.Name) | |
FROM sys.Objects o | |
INNER JOIN sys.Schemas s on o.schema_id = s.schema_id | |
WHERE s.Name = 'umbracoprd01' | |
And (o.Type = 'U' Or o.Type = 'P' Or o.Type = 'V'); | |
EXEC sys.sp_executesql @sql; | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment