Click here to Skip to main content
16,019,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
1. How can i rename table names in DB by using just one query to rename all tables that start like 'order_' ?

2. How can i rename stored procedure names by using just one query to rename all procedure that start like 'order_' ?

3.How can i rename all tables names that changed inside these procedures ?

Thanks for all .
Posted
Updated 23-Mar-12 3:23am
v3
Comments
[no name] 23-Mar-12 9:03am    
STOP repeating the question.

If you have additional information then edit this question or respond to answers already given.

1 solution

sp_rename[^]

You can find the tables and procedures in the sysobjects table.

As for changing all of the references to tables within the stored procedures that will be more difficult. T-SQL isn't the best for string editing. You could create a managed stored procedure and use C# to handle this part.

However, the best approach, IMO, would be to use VS Database edition, or similar tool, if you have it so you could maintain a script and be able to rollback in case anything goes wrong.
 
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