1
Change DB Owner For SQL 2005,2008,2012 database objects
Problem reported by Greg C. - June 21, 2015 at 7:29 AM
Submitted
Employee Post
Step1: Get All Alter SQL commands(Table,SP,View)
SELECT 'ALTER SCHEMA dbo TRANSFER ' + s.Name + '.' + o.Name
FROM sys.Objects o
INNER JOIN sys.Schemas s on o.schema_id = s.schema_id
WHERE s.Name = 'OldName'
And (o.Type = 'U' Or o.Type = 'P' Or o.Type = 'V')
 
Step2: Select all SQL commands and open a new windows then Execute the SQL Scripts

Reply to Thread