November 11, 2003 at 9:49 am
Hello,
I have to change a table name across all servers and I want to find all the views which have dependency to that table. Is there a way to find that out?
Thank you
November 11, 2003 at 2:10 pm
Here is a way you could find out which views have the table in their definition across one server, assuming your haven't created the view WITH ENCRYPTION
sp_MSforeachdb @command1 = 'Print ''?''', @command2 = 'select b.name, a.text from ?.dbo.syscomments a inner join ?.dbo.sysobjects b on a.id = b.id and b.type = ''V''
where a.text like ''%[TableName]%'''
I don't think you can check for dependencies across servers, if that's what you are trying to do.
JM
November 11, 2003 at 3:02 pm
the only way you could check across all servers would be if you have linked servers connecting them.
Steve Jones
http://www.sqlservercentral.com/columnists/sjones
The Best of SQL Server Central.com 2002 - http://www.sqlservercentral.com/bestof/
November 12, 2003 at 5:58 am
Thank you for all your help.
Actually the result of JM's query, was the the script of all views in the server and I searched for my table name in the result. I did the same for all servers.
November 12, 2003 at 5:58 am
Thank you for all your help.
Actually the result of JM's query, was the the script of all views in the server and I searched for my table name in the result. I did the same for all servers.
November 12, 2003 at 8:34 am
If the view and table are in the same database, EM, table, All Tasks, display dependencies is a nice interactive way to view all dependencies. It's a shame it does not work across databases.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply