Red Gate forums :: View topic - Refactor table to view
Return to RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Refactor 1
SQL Refactor 1 forum

Refactor table to view

Search in SQL Refactor 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message

Joined: 20 Apr 2007
Posts: 8

PostPosted: Thu Jul 23, 2009 3:10 pm    Post subject: Refactor table to view Reply with quote

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?
Back to top
View user's profile Send private message
Anu Deshpande

Joined: 20 Apr 2009
Posts: 692
Location: Cambridge

PostPosted: Fri Jul 24, 2009 12:07 pm    Post subject: Reply with quote

Thanks for your post.

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.
Anuradha Deshpande
Product Support
Redgate Software Ltd.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group