<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Refactoring on SQL Server Scripts</title><link>https://www.sqlserver70.com/tags/refactoring/</link><description>Recent content in Refactoring on SQL Server Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>SQLServer70.com</copyright><lastBuildDate>Sat, 23 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.sqlserver70.com/tags/refactoring/index.xml" rel="self" type="application/rss+xml"/><item><title>SQL Server Object Dependencies Report: Find All References</title><link>https://www.sqlserver70.com/post/sql-server-object-dependencies-script/</link><pubDate>Sat, 23 May 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-object-dependencies-script/</guid><description>
&lt;p&gt;Before renaming a column, retiring a view, or dropping a stored procedure, every DBA needs the answer to one question: what else depends on this object? This T-SQL script reads &lt;code&gt;sys.sql_expression_dependencies&lt;/code&gt; and reports every referencing-and-referenced pair in the current database, with optional filtering to a single object name — the safe-refactoring impact analysis report.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;SQL Server tracks expression-level dependencies between user objects in the catalog view &lt;code&gt;sys.sql_expression_dependencies&lt;/code&gt;. Every reference from a stored procedure, function, view, trigger, default, computed column, or check constraint to another object — table, view, function, procedure, type, or column — produces a row. The view supersedes the legacy &lt;code&gt;sys.sql_dependencies&lt;/code&gt; view (deprecated in SQL Server 2008) and the older &lt;code&gt;sp_depends&lt;/code&gt; stored procedure (which has always been unreliable for cross-database and late-bound references). Modern dependency tracking is metadata-only, schema-bound-aware, and accurate across cross-database name resolutions.&lt;/p&gt;</description></item></channel></rss>