SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Idendtiy table used by Stored procedures sqlserver
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kond.mohan
Posting Yak Master

India
185 Posts

Posted - 02/19/2013 :  01:42:19  Show Profile  Reply with Quote
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

India
52249 Posts

Posted - 02/19/2013 :  01:50:27  Show Profile  Reply with Quote
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

India
185 Posts

Posted - 02/19/2013 :  06:54:38  Show Profile  Reply with Quote
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

India
52249 Posts

Posted - 02/19/2013 :  07:32:00  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000