Refactor table to view
neilx
Posts: 14
If I want to rename a table and use a view in its place to prevent applications from breaking, how can I do this?
If I use smart rename, then absolutely everywhere the table is mentioned is changed. Could I limit the changes to tables only (e.g. relationships and triggers) and then create a view with the original name of the table?
Would I be better off scripting the database, creating the view in the script then renaming the table name occurences mainually so I can choose only the occurences I want?
If I use smart rename, then absolutely everywhere the table is mentioned is changed. Could I limit the changes to tables only (e.g. relationships and triggers) and then create a view with the original name of the table?
Would I be better off scripting the database, creating the view in the script then renaming the table name occurences mainually so I can choose only the occurences I want?
Comments
Yes you can follow the below mentioned steps:
1. Rename the table with view.
2. Follow the <Smart Rename> wizard and SQL Refactor will generate the script for the rename of that object.
3. You can than manually remove the queries where you do not want the object rename to be executed.
Kindly let us know if that helped.
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com