<?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>ProtoAspx &#187; sql</title>
	<atom:link href="http://www.gljakal.com/protoaspx/category/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gljakal.com/protoaspx</link>
	<description>Integrating Prototype and ASP.Net to create the next generation of web applications</description>
	<lastBuildDate>Thu, 26 Feb 2009 17:49:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SQL Server trick: finding text in multiple stored procedures</title>
		<link>http://www.gljakal.com/protoaspx/2009/02/sql-server-trick-finding-text-in-multiple-stored-procedures/</link>
		<comments>http://www.gljakal.com/protoaspx/2009/02/sql-server-trick-finding-text-in-multiple-stored-procedures/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 17:46:56 +0000</pubDate>
		<dc:creator>Loris</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.gljakal.com/protoaspx/2009/02/sql-server-trick-finding-text-in-multiple-stored-procedures/</guid>
		<description><![CDATA[Sometimes I need to know which stored procedures or views are using a particular table or field.
Most people I&#8217;ve seen, when presented with this problem do this the long, boring and potentially error-prone way: opening up each and every stored procedure or view in SSMS and using the good old &#34;Find and replace&#34; tool to [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I need to know which stored procedures or views are using a particular table or field.</p>
<p>Most people I&#8217;ve seen, when presented with this problem do this the long, boring and potentially error-prone way: opening up each and every stored procedure or view in SSMS and using the good old &quot;Find and replace&quot; tool to find out whether it is using the table or field we&#8217;re looking for.</p>
<p>There is, however, a much, much better way to do this, with a simple SQL query. Suppose we want to find out which stored procedure or view uses the table <code>foobar</code>:</p>
<pre class="csharpcode"><span class="kwrd">SELECT DISTINCT</span> OBJECT_NAME(ID) <span class="kwrd">FROM</span> <span style="color: #080">SYS.SYSCOMMENTS</span> <span class="kwrd">WHERE</span> [TEXT] <span class="kwrd">LIKE</span> <span class="str">'%foobar%'</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gljakal.com/protoaspx/2009/02/sql-server-trick-finding-text-in-multiple-stored-procedures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
