This one looks promising:
http://stackoverflow.com/questions/2983857/how-to-do-bulk-update-of-views
SELECT
REPLACE (REPLACE (sm.definition, 'CREATE VIEW', 'ALTER VIEW'), 'DB1.', 'DB2.') + '
GO'
FROM
sys.sql_modules sm
JOIN
sys.objects o ON sm.object_id = o.object_id
WHERE
sm.definition LIKE '%DB1.%' AND o.type = 'V'
[cid:2a7969.png@46e080b9.4494a3db]
Joe Rojas
Director of Information Technology
(781) 408-9278 Mobile
(781) 573-0291 Local
(781) 232-5191 Fax
[http://matsinc.com/images/e-mail-signatures/tagline.jpg%5d
[http://matsinc.com/images/e-mail-signatures/graphics/logo_matsinc.png%5d<http://matsinc.com> [http://matsinc.com/images/e-mail-signatures/graphics/icon_twitter.png%5d <http://twitter.com/Mats_Inc> [http://matsinc.com/images/e-mail-signatures/graphics/icon_facebook.png%5d <http://www.facebook.com/commercial.flooring> [http://matsinc.com/images/e-mail-signatures/graphics/icon_youtube.png%5d <http://www.youtube.com/user/MatsIncTV> [http://matsinc.com/images/e-mail-signatures/graphics/icon_pinterest.png%5d <http://www.pinterest.com/contractfloors/> [http://matsinc.com/images/e-mail-signatures/graphics/icon_blog.png%5d <http://matsinc.com/blog>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Saturday, October 17, 2015 1:30 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Slightly OT: SQL Server mass update of views
Will be interested if you find something.
In past moves I've had to update views manually.
Another move was postponed (thankfully) & I haven't thought about this since.
I had been trying a linked server named to trick the old views/reports, just to get by in the short term.
I found a couple of posts too but did not test anything..
How to do bulk update of views?<http://stackoverflow.com/questions/2983857/how-to-do-bulk-update-of-views>
[Image removed by sender. image]<http://stackoverflow.com/questions/2983857/how-to-do-bulk-update-of-views>
How to do bulk update of views? <http://stackoverflow.com/questions/2983857/how-to-do-bulk-update-of-views>
My database has about 30 views, most of which have a reference to another database on this server (call it DB1). Now, without going into the reasons why, I ne...
View on stackoverflow.com <http://stackoverflow.com/questions/2983857/how-to-do-bulk-update-of-views>
Preview by Yahoo
Mass editing of SQL Server objects - Tomas Lind<http://tomaslind.net/2014/12/10/mass-editing-sql-server-objects/>
[Image removed by sender. image]<http://tomaslind.net/2014/12/10/mass-editing-sql-server-objects/>
Mass editing of SQL Server objects - Tomas Lind <http://tomaslind.net/2014/12/10/mass-editing-sql-server-objects/>
A method for mass editing SQL Server objects.
View on tomaslind.net <http://tomaslind.net/2014/12/10/mass-editing-sql-server-objects/>
Preview by Yahoo
[Non-text portions of this message have been removed]
http://stackoverflow.com/questions/2983857/how-to-do-bulk-update-of-views
SELECT
REPLACE (REPLACE (sm.definition, 'CREATE VIEW', 'ALTER VIEW'), 'DB1.', 'DB2.') + '
GO'
FROM
sys.sql_modules sm
JOIN
sys.objects o ON sm.object_id = o.object_id
WHERE
sm.definition LIKE '%DB1.%' AND o.type = 'V'
[cid:2a7969.png@46e080b9.4494a3db]
Joe Rojas
Director of Information Technology
(781) 408-9278 Mobile
(781) 573-0291 Local
(781) 232-5191 Fax
[http://matsinc.com/images/e-mail-signatures/tagline.jpg%5d
[http://matsinc.com/images/e-mail-signatures/graphics/logo_matsinc.png%5d<http://matsinc.com> [http://matsinc.com/images/e-mail-signatures/graphics/icon_twitter.png%5d <http://twitter.com/Mats_Inc> [http://matsinc.com/images/e-mail-signatures/graphics/icon_facebook.png%5d <http://www.facebook.com/commercial.flooring> [http://matsinc.com/images/e-mail-signatures/graphics/icon_youtube.png%5d <http://www.youtube.com/user/MatsIncTV> [http://matsinc.com/images/e-mail-signatures/graphics/icon_pinterest.png%5d <http://www.pinterest.com/contractfloors/> [http://matsinc.com/images/e-mail-signatures/graphics/icon_blog.png%5d <http://matsinc.com/blog>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Saturday, October 17, 2015 1:30 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Slightly OT: SQL Server mass update of views
Will be interested if you find something.
In past moves I've had to update views manually.
Another move was postponed (thankfully) & I haven't thought about this since.
I had been trying a linked server named to trick the old views/reports, just to get by in the short term.
I found a couple of posts too but did not test anything..
How to do bulk update of views?<http://stackoverflow.com/questions/2983857/how-to-do-bulk-update-of-views>
[Image removed by sender. image]<http://stackoverflow.com/questions/2983857/how-to-do-bulk-update-of-views>
How to do bulk update of views? <http://stackoverflow.com/questions/2983857/how-to-do-bulk-update-of-views>
My database has about 30 views, most of which have a reference to another database on this server (call it DB1). Now, without going into the reasons why, I ne...
View on stackoverflow.com <http://stackoverflow.com/questions/2983857/how-to-do-bulk-update-of-views>
Preview by Yahoo
Mass editing of SQL Server objects - Tomas Lind<http://tomaslind.net/2014/12/10/mass-editing-sql-server-objects/>
[Image removed by sender. image]<http://tomaslind.net/2014/12/10/mass-editing-sql-server-objects/>
Mass editing of SQL Server objects - Tomas Lind <http://tomaslind.net/2014/12/10/mass-editing-sql-server-objects/>
A method for mass editing SQL Server objects.
View on tomaslind.net <http://tomaslind.net/2014/12/10/mass-editing-sql-server-objects/>
Preview by Yahoo
[Non-text portions of this message have been removed]