<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Object Dependency &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/object-dependency/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Tue, 21 Nov 2017 06:09:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>Find Table Dependency in MySQL</title>
		<link>https://www.dbrnd.com/2015/08/find-table-dependency-in-constraint-view-stored-procedure-of-mysql/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 15 Aug 2015 06:18:00 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL DBA Script]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[Object Dependency]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=381</guid>

					<description><![CDATA[In this post, I am sharing different scripts to find table dependency for Foreign Key Constraint, View and Stored Procedure of MySQL. Database Architecture or Database Developer has to find table dependency before any DDL changes on the Tables. Below are three different scripts: [crayon-6ab5600f209ea117607826/] [crayon-6ab5600f209ee740607949/] [crayon-6ab5600f209f0952191701/]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Ffind-table-dependency-in-constraint-view-stored-procedure-of-mysql%2F&amp;linkname=Find%20Table%20Dependency%20in%20MySQL" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Ffind-table-dependency-in-constraint-view-stored-procedure-of-mysql%2F&amp;linkname=Find%20Table%20Dependency%20in%20MySQL" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Ffind-table-dependency-in-constraint-view-stored-procedure-of-mysql%2F&amp;linkname=Find%20Table%20Dependency%20in%20MySQL" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Ffind-table-dependency-in-constraint-view-stored-procedure-of-mysql%2F&amp;linkname=Find%20Table%20Dependency%20in%20MySQL" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Ffind-table-dependency-in-constraint-view-stored-procedure-of-mysql%2F&amp;linkname=Find%20Table%20Dependency%20in%20MySQL" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Ffind-table-dependency-in-constraint-view-stored-procedure-of-mysql%2F&amp;linkname=Find%20Table%20Dependency%20in%20MySQL" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Ffind-table-dependency-in-constraint-view-stored-procedure-of-mysql%2F&#038;title=Find%20Table%20Dependency%20in%20MySQL" data-a2a-url="https://www.dbrnd.com/2015/08/find-table-dependency-in-constraint-view-stored-procedure-of-mysql/" data-a2a-title="Find Table Dependency in MySQL"></a></p><p>In this post, I am sharing different scripts to find table dependency for Foreign Key<br />
Constraint, View and Stored Procedure of MySQL.</p>
<p>Database Architecture or Database Developer has to find table dependency before any DDL changes on the Tables.</p>
<p><strong>Below are three different scripts: </strong></p>
<pre class="crayon-plain-tag">/*Find Table Dependency in Foreign Key Constraint.*/
SELECT 
     Constraint_Type
    ,Constraint_Name
    ,Table_Schema
    ,Table_Name
FROM information_schema.table_constraints
WHERE Constraint_Type = 'FOREIGN KEY'
    AND Table_Name = 'Any_Table'
    AND Table_Schema ='db_Name';</pre> </p>
<pre class="crayon-plain-tag">/*Find Table Dependency in Views.*/
SELECT *
FROM information_schema.views 
WHERE Table_Schema='db_name' 
  AND Table_Name = 'table_name'</pre> </p>
<pre class="crayon-plain-tag">/*Find Table Dependency in Stored Procedure.*/
SELECT 
    Table_Schema
    ,Table_Name
    ,Table_Type
    ,Engine
    ,Routine_Name
    ,Routine_Schema
    ,Routine_Type
FROM information_schema.tables
 INNER JOIN information_schema.routines
    ON routines.routine_definition 
    LIKE  Concat('%', tables.table_name, '%')
WHERE Table_Schema ='db_name'</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Script to find Cross Database Object Dependency in SQL Server</title>
		<link>https://www.dbrnd.com/2015/06/sql-script-to-find-cross-database-object-dependency-in-sql-server/</link>
					<comments>https://www.dbrnd.com/2015/06/sql-script-to-find-cross-database-object-dependency-in-sql-server/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 20 Jun 2015 12:35:06 +0000</pubDate>
				<category><![CDATA[Script]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Cross Database]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[Object Dependency]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=267</guid>

					<description><![CDATA[In the previous post, I Have provided three different scripts to find Object Dependency in the current database. In this post I share one SQL script to find Cross Database Object Dependency in SQL Server. [crayon-6ab5600f20dc1654587452/]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-cross-database-object-dependency-in-sql-server%2F&amp;linkname=SQL%20Script%20to%20find%20Cross%20Database%20Object%20Dependency%20in%20SQL%20Server" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-cross-database-object-dependency-in-sql-server%2F&amp;linkname=SQL%20Script%20to%20find%20Cross%20Database%20Object%20Dependency%20in%20SQL%20Server" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-cross-database-object-dependency-in-sql-server%2F&amp;linkname=SQL%20Script%20to%20find%20Cross%20Database%20Object%20Dependency%20in%20SQL%20Server" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-cross-database-object-dependency-in-sql-server%2F&amp;linkname=SQL%20Script%20to%20find%20Cross%20Database%20Object%20Dependency%20in%20SQL%20Server" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-cross-database-object-dependency-in-sql-server%2F&amp;linkname=SQL%20Script%20to%20find%20Cross%20Database%20Object%20Dependency%20in%20SQL%20Server" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-cross-database-object-dependency-in-sql-server%2F&amp;linkname=SQL%20Script%20to%20find%20Cross%20Database%20Object%20Dependency%20in%20SQL%20Server" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-cross-database-object-dependency-in-sql-server%2F&#038;title=SQL%20Script%20to%20find%20Cross%20Database%20Object%20Dependency%20in%20SQL%20Server" data-a2a-url="https://www.dbrnd.com/2015/06/sql-script-to-find-cross-database-object-dependency-in-sql-server/" data-a2a-title="SQL Script to find Cross Database Object Dependency in SQL Server"></a></p><p>In the previous post, I Have provided three different scripts to find Object Dependency in the current database.</p>
<p>In this post I share one SQL script to find Cross Database Object Dependency in SQL Server.</p>
<pre class="crayon-plain-tag">SELECT  
	OBJECT_NAME (referencing_id) AS ReferencedObjects
	,referenced_database_name
	,referenced_schema_name
	,referenced_entity_name
FROM sys.sql_expression_dependencies
WHERE referenced_database_name IS NOT NULL
AND is_ambiguous = 0;</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2015/06/sql-script-to-find-cross-database-object-dependency-in-sql-server/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Script to find Object Dependency in SQL Server</title>
		<link>https://www.dbrnd.com/2015/06/sql-script-to-find-object-dependency-in-sql-server/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 20 Jun 2015 12:26:30 +0000</pubDate>
				<category><![CDATA[Script]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[Object Dependency]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=260</guid>

					<description><![CDATA[As a DBA or Database Developer, we need to find the object dependency into the current database. Finding the Object Dependency is very useful before any alteration on object like ALTER, DROP. Below are three reference scripts to find the object dependency. [crayon-6ab5600f20f29383677946/] [crayon-6ab5600f20f2b224158281/] [crayon-6ab5600f20f2c098153020/]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-object-dependency-in-sql-server%2F&amp;linkname=SQL%20Script%20to%20find%20Object%20Dependency%20in%20SQL%20Server" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-object-dependency-in-sql-server%2F&amp;linkname=SQL%20Script%20to%20find%20Object%20Dependency%20in%20SQL%20Server" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-object-dependency-in-sql-server%2F&amp;linkname=SQL%20Script%20to%20find%20Object%20Dependency%20in%20SQL%20Server" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-object-dependency-in-sql-server%2F&amp;linkname=SQL%20Script%20to%20find%20Object%20Dependency%20in%20SQL%20Server" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-object-dependency-in-sql-server%2F&amp;linkname=SQL%20Script%20to%20find%20Object%20Dependency%20in%20SQL%20Server" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-object-dependency-in-sql-server%2F&amp;linkname=SQL%20Script%20to%20find%20Object%20Dependency%20in%20SQL%20Server" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F06%2Fsql-script-to-find-object-dependency-in-sql-server%2F&#038;title=SQL%20Script%20to%20find%20Object%20Dependency%20in%20SQL%20Server" data-a2a-url="https://www.dbrnd.com/2015/06/sql-script-to-find-object-dependency-in-sql-server/" data-a2a-title="SQL Script to find Object Dependency in SQL Server"></a></p><p>As a DBA or Database Developer, we need to find the object dependency into the current database.</p>
<blockquote><p>Finding the Object Dependency is very useful before any alteration on object like ALTER, DROP.</p></blockquote>
<p>Below are three reference scripts to find the object dependency. </p>
<pre class="crayon-plain-tag">SELECT OBJECT_NAME(OBJECT_ID)
  FROM sys.sql_modules
 WHERE DEFINITION LIKE '%tbl_Employee%'
GO</pre>
<pre class="crayon-plain-tag">SELECT DISTINCT 
	SO.Name
	,SO.XType AS ObjectType
	,SC.TEXT AS ObjectDefinition
FROM syscomments AS SC
INNER JOIN sysobjects AS SO ON SC.id=SO.id
WHERE SC.TEXT LIKE '%tablename%'
GO</pre>
<pre class="crayon-plain-tag">SELECT 
    referencing_schema_name, referencing_entity_name, referencing_id, 
    referencing_class_desc, is_caller_dependent
FROM 
    sys.dm_sql_referencing_entities ('SchemaName.TableName', 'Object');
GO</pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
