Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello Friends....

I have database that will contain some of the tables and store procedure with user define schema like xyx.tablename or xyx.storeprocedure name...

but i want to restore it to default schema like dbo.tablename and dbo.storeprocedurename

how to change a schema to a default one.. i have 28 tables and 86 storeprocedure which will be set by this default schema with "dbo." insted of "xyx."


what i actually change is the refrance of table and storeprocedures reference schema
Posted
Updated 1-Sep-11 3:22am
v2

1 solution

Use this query:
SQL
ALTER SCHEMA newschema TRANSFER oldschema.ObjectName

This[^] post contains information to auto-generate the ALTER statements using a query.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900