View Full Version : query all views in SQL database

16-04-2014, 08:49 AM
Hi all,

I have 97 views that I need to query to find which database the view looks at. We are running a database migration and the views are all pointing currently at our test database environment and while I have gone through and changed the reference of all the views to point at our production database I need to double-check that I haven't missed any.

These views are used for the data migration, so need to be looking at the right place :)

SQL Server 2008 R2


16-04-2014, 09:27 AM
Have you tried this (http://msdn.microsoft.com/en-us/library/ms190378.aspx)