Mass Table Renaming

Monica Rathbun needed to rename a table in a lot of scripts.  Here’s how she did it:

The quick answer that I came up with is to script out all of the stored procedures into a single query window.  This can be done easily through the GUI.  Once that is complete, I can easily do a “Find & Replace” on the table name and we’re done!

Ideally, those stored procedures are in source control already and you do your find-and-replace there, but sometimes you can’t control that.

Related Posts

Getting To ZDT

Kendra Little gives thoughts on getting to zero-downtime releases: I’ve worked in a bunch of environments where we rolled schema changes to production throughout the week, and worked hard to limit downtime. Our biggest challenges were: The code released wouldn’t have the intended effect, and multiple hotfixes would sometimes need to be written quickly if the […]

Read More

Refactoring In SSDT

Ed Elliott has an introductory-level article on refactoring code within SQL Server Data Tools: SSDT helps us to refactor code by automating the actions of: Expanding wildcards Fully qualifying object names Moving objects to a different schema Renaming objects Aside from this list SSDT also, of course, helps us to refactor code manually with its […]

Read More

Categories

December 2015
MTWTFSS
« Nov Jan »
 123456
78910111213
14151617181920
21222324252627
28293031