I have approximately 100 SQL views that are a variation of this:
select * from RTC.dbo.MyTable
…now I find I need to change the name of the RTC table to something else. Rather than edit one view at a time, is there a way to script out all their drop/create statements to a text file so that I can do a global replacement?
In SSMS right click the database, go to Tasks and select there ‘Generate Scripts…’. Select ‘Views’, select the views you want exported, export.