Script results so we can easily replace text/columns/code in large amounts of tables/views/sprocs and even across databases
In search result windows , multiselect is possible. On right click give option to script out selected objects.
Workaround i use for now:
What i usually do is open sql compare alongside and then select results from a single database and compare them to an empty database, script all out, and then replace create statements with alter.
-
Keith Roe commented
I recently installed SQL Reports. The database and temp database were named weird on the old server. So, when I recreated the database and temp database, there was a name mismatch between the two. In order to resolve the issue, I had to script out all the mentions of the temp database in the report server database. There were close to 80 sprocs and views that had to be scripted out by double-clicking to go to the item and then right-clicking and scripting them to clipboard and then pasting them in notepad (because for some MSSMS kept crashing). I was then able to do a search and replace in the script and run it. A lot more work than I should have had to do!!
-
Anonymous commented
Script search result (selected or otherwise) to a single drop and create script would help a lot. with dependency order in mind of-course :)
-
Jack commented
I would love this ability just like SQLPrompt has the F12 script option for SP's, Views, etc...
-
kkam commented
This would be very helpful when refactoring a database. Finding the long list of objects that you have to edit to adapt to a new pattern is nice but somewhat discouraging as it doesn't get you to the goal.
The goal would be as requested above, allow me to select multiple objects from the listing returned and right-click to "Script Objects to New Query Window". THAT would be a huge timesaver!!!
-
Bryan Ellis commented
If results are from multiple databases, generate a separate script for each one with the matching objects in it.