Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have created a database and all object like tables stored procedure and user defined table type under a default schema (dbo).

Now i want to create a new schema and to map all my stored procedure to New schema.
So that all changes to the table happens only through stored procedure and to avoid direct DML on my table.Also to map this schema to [NT AUTHORITY\NETWORK SERVICE] user role.

Thanks in advance.
Posted
Comments
Arun Vasu 27-May-13 4:27am    
try this
ALTER SCHEMA dbo TRANSFER jonathan.MovieData;

Create the new schema
Script all the procedures create to SSMS query
Search and replace on dbo replacing it with the new schema
run the script

You should now have 2 copies of all the procedures
 
Share this answer
 
Hi
You can use Query like this...
SQL
ALTER SCHEMA the destination schema TRASFER Object::current schema.TableName;
For Example : ALTER SCHEMA dbo TRANSFER HWData.DesktopSoft_Master;

Check the following links...
Script to move all objects to a new schema for SQL Server[^]
How To Change SQL Server 2008/2005 Object Schema?[^]
Regards,
GVPrabu
 
Share this answer
 
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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