Hi Friends
Few days ago I have restore my SQL Server 2005 database to SQL Server 2008 Database using xxx user, now when i have restore database by defaut SQL Server 2008 backup utility add schema of username to tables and store procedure, so to remove that schema from tables and procedure name please use below query
-- To Change Table Schema
SELECT 'ALTER SCHEMA dbo TRANSFER ' + s.Name + '.' + p.Name FROM sys.tables p INNER JOIN
sys.Schemas s on p.schema_id = s.schema_id WHERE s.Name = 'checkmate'
-- To Change Procedure Schema
SELECT 'ALTER SCHEMA dbo TRANSFER ' + s.Name + '.' + p.Name FROM sys.procedures p INNER JOIN
sys.Schemas s on p.schema_id = s.schema_id WHERE s.Name = 'checkmate'
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment