Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Idendtiy table used by Stored procedures sqlserver

Author  Topic 

kond.mohan
Posting Yak Master

213 Posts

Posted - 2013-02-19 : 01:42:19
hi all,
i have loaded all Required tables from oracle to Sql server in
DB1. and i have created few stored procedures on DB1 database and i have created few stored procedures on DB2 database. i need to identify which table is using which stored procedure.
is there any script to identify all the objects.
i have used by dependencies option. but it is showing tables existing database (db1)procedures only.it is not showing another database procedure.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-19 : 01:50:27
see

http://visakhm.blogspot.in/2010/01/finding-cross-server-cross-db-object.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

kond.mohan
Posting Yak Master

213 Posts

Posted - 2013-02-19 : 06:54:38
THX Vishak.

Following query is used to identify the SQLOBJECTS Across the WHOLE Database.
SELECT referencing_entity_name
FROM sys.dm_sql_referencing_entities ('DENTAL', 'OBJECT')
this is working fine.

but my need is
identify the SQLOBJECTS Across the Server or specified Databases.
because my staging area is different(i.e tables are existed in SAMPLE1 database.i have used sample1 tables in SAMPLE2 database.)


Advance thx.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-19 : 07:32:00
did you check the article completely? Have a look at sys.sql_expression_dependencies

http://msdn.microsoft.com/en-us/library/bb677315.aspx



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -