On an MS SQL Server 2000 installation I have numerous stored procedures that pull data from databases other than the one it’s stored in. All selects occur on the same database server. For example:
select * from [OtherDatabase]..table
How can I find which procedures do that sort of thing without eyeballing each one?
The following is a stored proc that will search for text contained in any stored proc. You could use this to search for the various databases that might get called.