Red Gate forums :: View topic - automate sql refactor
Return to www.red-gate.com RSS Feed Available

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

automate sql refactor

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



Joined: 18 Feb 2010
Posts: 4

PostPosted: Thu Feb 18, 2010 1:07 pm    Post subject: automate sql refactor Reply with quote

Hi.

I auto generate thousands of SP's at a time in Sql Server 2005 (with sql refactor 1.3). Is there a way to make sql refactor layout all these SP's at once? I cannot go into these individually and reformat!

I cant seem to see anything in the menu.

Thanks.
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1124
Location: Twitter: @dtabase

PostPosted: Thu Feb 18, 2010 2:54 pm    Post subject: Reply with quote

Sorry, there's currently no way of doing this, although it's a strong candidate to resolve in a future release.

Can I ask how you would expect this to work? Would you allow the tool to modify and apply the new formatting in your database blind? The current methodology formats the text in the query window so you can review what it has done before applying it to the database.

Kind regards,

David Atkinson
Product Manager
Red Gate Software
Back to top
View user's profile Send private message Send e-mail
pauldavidson



Joined: 18 Feb 2010
Posts: 4

PostPosted: Thu Feb 18, 2010 2:57 pm    Post subject: Reply with quote

Hi.

Yes I would want it to apply and do it blind.

Perhaps if you click on the stored procedures link at the left, and then have the right window showing the 'object explorer details' window. It would show all SP's as it currently does. Then you could, say, select a few of them, and right click and have an option in your context menu to execute the formatting. Or even by just right clicking a database in the left window be shown a context menu.

Thanks.
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1124
Location: Twitter: @dtabase

PostPosted: Thu Feb 18, 2010 3:02 pm    Post subject: Reply with quote

Multi-selection of individual objects isn't currently possible in the object explorer, but it could exist in the context menu at the database level or the object type level.

Thanks for your suggestion!

David
Back to top
View user's profile Send private message Send e-mail
pauldavidson



Joined: 18 Feb 2010
Posts: 4

PostPosted: Thu Feb 18, 2010 3:07 pm    Post subject: Re: Reply with quote

David Atkinson wrote:
Multi-selection of individual objects isn't currently possible in the object explorer, but it could exist in the context menu at the database level or the object type level.

Thanks for your suggestion!

David


In the object explorer details window in sql server, if i shift click or ctrl click on items, it selects multiple objects. Or do you mean you cant change the context menu for multi selects?

Is there anyway I can frig sql reformat just now to do it? Any sort of command line stuff I could write?
Back to top
View user's profile Send private message
pauldavidson



Joined: 18 Feb 2010
Posts: 4

PostPosted: Thu Feb 18, 2010 5:56 pm    Post subject: Reply with quote

After having a discussion with David from Redgate, we have come up with a workaround to do exactly this, until a new feature is added to Sql Refactor.

If you go into the 'object explorer details' pane, highlight multiple stored procedures, right click and choose to script a "create to" window. Then do a find and replace on the whole script changing "CREATE PROC" to "ALTER PROC", you can then choose to reformat this one script, and run it.

The only problem with this in my case is that I have several thousand SP's, so it can take some time to actually create the long script. Something like 10 - 15 mins!

But it works.
Back to top
View user's profile Send private message
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