<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; 2005 2000 &#8211; Search String in Stored Procedure</title>
	<atom:link href="http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Sun, 12 Feb 2012 09:22:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Varsha</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-219483</link>
		<dc:creator><![CDATA[Varsha]]></dc:creator>
		<pubDate>Fri, 16 Dec 2011 17:21:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-219483</guid>
		<description><![CDATA[Do you have a stored procedure for comparison of fields/columns in the same table? I want to see whether the names of field1, field2 and field 3 are the same, if yes then do something]]></description>
		<content:encoded><![CDATA[<p>Do you have a stored procedure for comparison of fields/columns in the same table? I want to see whether the names of field1, field2 and field 3 are the same, if yes then do something</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nelson Thimothiyose</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-207077</link>
		<dc:creator><![CDATA[Nelson Thimothiyose]]></dc:creator>
		<pubDate>Tue, 29 Nov 2011 09:21:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-207077</guid>
		<description><![CDATA[Is there any way to find out , the table names used with in a procedure.???]]></description>
		<content:encoded><![CDATA[<p>Is there any way to find out , the table names used with in a procedure.???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anil Anjana</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-192239</link>
		<dc:creator><![CDATA[Anil Anjana]]></dc:creator>
		<pubDate>Thu, 10 Nov 2011 12:58:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-192239</guid>
		<description><![CDATA[Thanks dear if you are not here than what happen with us only god knows that.....??? 


Thanks a lot !!!!!!!!!!]]></description>
		<content:encoded><![CDATA[<p>Thanks dear if you are not here than what happen with us only god knows that&#8230;..??? </p>
<p>Thanks a lot !!!!!!!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shafiq</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-165112</link>
		<dc:creator><![CDATA[shafiq]]></dc:creator>
		<pubDate>Sat, 03 Sep 2011 12:32:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-165112</guid>
		<description><![CDATA[Hi all,
i have store procedure for search,which search my tables and give me the result.
now i need a store procedure which will show related search result just like google do....&quot;did you mean etc&quot; etc....how can i do it]]></description>
		<content:encoded><![CDATA[<p>Hi all,<br />
i have store procedure for search,which search my tables and give me the result.<br />
now i need a store procedure which will show related search result just like google do&#8230;.&#8221;did you mean etc&#8221; etc&#8230;.how can i do it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tharak</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-160931</link>
		<dc:creator><![CDATA[Tharak]]></dc:creator>
		<pubDate>Tue, 23 Aug 2011 09:32:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-160931</guid>
		<description><![CDATA[Hi ,
I need SQL statement to search table and column names in a database only knowing String value.

eg;  for say in a database i know employee Name ( xxxx )  only,
 not the table or column name so how can i find table and column name using ( xxxx) Value .

Please help me i am using SQL server 2008.

[email removed]

Thanks in advance .
Tharak.]]></description>
		<content:encoded><![CDATA[<p>Hi ,<br />
I need SQL statement to search table and column names in a database only knowing String value.</p>
<p>eg;  for say in a database i know employee Name ( xxxx )  only,<br />
 not the table or column name so how can i find table and column name using ( xxxx) Value .</p>
<p>Please help me i am using SQL server 2008.</p>
<p>[email removed]</p>
<p>Thanks in advance .<br />
Tharak.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ashu</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-158771</link>
		<dc:creator><![CDATA[ashu]]></dc:creator>
		<pubDate>Thu, 18 Aug 2011 10:23:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-158771</guid>
		<description><![CDATA[How can i search in the textbox the name- Mark Daniel. As it contains space between the name]]></description>
		<content:encoded><![CDATA[<p>How can i search in the textbox the name- Mark Daniel. As it contains space between the name</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brotherUK</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-155831</link>
		<dc:creator><![CDATA[brotherUK]]></dc:creator>
		<pubDate>Wed, 10 Aug 2011 15:27:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-155831</guid>
		<description><![CDATA[good example but there is a problem !!
if the string i&#039;m looking for is at starting or at the end, this example doesnt return the that value. what will be the solution in that case ?]]></description>
		<content:encoded><![CDATA[<p>good example but there is a problem !!<br />
if the string i&#8217;m looking for is at starting or at the end, this example doesnt return the that value. what will be the solution in that case ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ric</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-125776</link>
		<dc:creator><![CDATA[Ric]]></dc:creator>
		<pubDate>Thu, 31 Mar 2011 11:21:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-125776</guid>
		<description><![CDATA[Thanks Pinal Dave, saved me a lot of time and effort. Much appreciated, and keep up the excellent posts!]]></description>
		<content:encoded><![CDATA[<p>Thanks Pinal Dave, saved me a lot of time and effort. Much appreciated, and keep up the excellent posts!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajesh</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-107047</link>
		<dc:creator><![CDATA[Rajesh]]></dc:creator>
		<pubDate>Tue, 21 Dec 2010 04:10:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-107047</guid>
		<description><![CDATA[Another best ways:

First:
select object_name(object_id),definition from sys.sql_modules where definition like &#039;%test%&#039; 

Second (Recommended) :
select ROUTINE_NAME, ROUTINE_DEFINITION from    
INFORMATION_SCHEMA.ROUTINES where ROUTINE_DEFINITION like &#039;%test%&#039; 


Reference from : Logiclabz]]></description>
		<content:encoded><![CDATA[<p>Another best ways:</p>
<p>First:<br />
select object_name(object_id),definition from sys.sql_modules where definition like &#8216;%test%&#8217; </p>
<p>Second (Recommended) :<br />
select ROUTINE_NAME, ROUTINE_DEFINITION from<br />
INFORMATION_SCHEMA.ROUTINES where ROUTINE_DEFINITION like &#8216;%test%&#8217; </p>
<p>Reference from : Logiclabz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ParkashKaur</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-78283</link>
		<dc:creator><![CDATA[ParkashKaur]]></dc:creator>
		<pubDate>Wed, 30 Jun 2010 10:41:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-78283</guid>
		<description><![CDATA[This query is worked perfectly with all words but it is FAIL when I give word &#039;ER&#039; it show name of all stored Procedures containing word like computER,Mother,researcher. Now how could find SP containing word &#039;ER&#039;?????


SELECT DISTINCT o.name ,o.xtype
FROM syscomments c
INNER JOIN sysobjects o ON c.id=o.id
WHERE c.TEXT LIKE &#039;ER%&#039; and o.xtype=&#039;P&#039;]]></description>
		<content:encoded><![CDATA[<p>This query is worked perfectly with all words but it is FAIL when I give word &#8216;ER&#8217; it show name of all stored Procedures containing word like computER,Mother,researcher. Now how could find SP containing word &#8216;ER&#8217;?????</p>
<p>SELECT DISTINCT o.name ,o.xtype<br />
FROM syscomments c<br />
INNER JOIN sysobjects o ON c.id=o.id<br />
WHERE c.TEXT LIKE &#8216;ER%&#8217; and o.xtype=&#8217;P&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: V.</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-69185</link>
		<dc:creator><![CDATA[V.]]></dc:creator>
		<pubDate>Wed, 05 May 2010 05:23:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-69185</guid>
		<description><![CDATA[Thanks it works like a charm!]]></description>
		<content:encoded><![CDATA[<p>Thanks it works like a charm!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran Mohammed</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-62852</link>
		<dc:creator><![CDATA[Imran Mohammed]]></dc:creator>
		<pubDate>Sat, 13 Mar 2010 06:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-62852</guid>
		<description><![CDATA[@Gunvant

Why don&#039;t you use Google.com, type display all tables in Sql Server 2005.

Use SQLAuthority Search to find out results to your search.

~IM.]]></description>
		<content:encoded><![CDATA[<p>@Gunvant</p>
<p>Why don&#8217;t you use Google.com, type display all tables in Sql Server 2005.</p>
<p>Use SQLAuthority Search to find out results to your search.</p>
<p>~IM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gunvant</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-62815</link>
		<dc:creator><![CDATA[gunvant]]></dc:creator>
		<pubDate>Fri, 12 Mar 2010 12:58:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-62815</guid>
		<description><![CDATA[Hi Pinal,

I need stored procedure  To find all stored procedure used by table in database
and want to display the names of stored procedure along with table name.]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>I need stored procedure  To find all stored procedure used by table in database<br />
and want to display the names of stored procedure along with table name.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bagyalakshmi</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-62025</link>
		<dc:creator><![CDATA[Bagyalakshmi]]></dc:creator>
		<pubDate>Tue, 02 Mar 2010 12:24:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-62025</guid>
		<description><![CDATA[How to construct a search store procedure using like search?]]></description>
		<content:encoded><![CDATA[<p>How to construct a search store procedure using like search?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marko Parkkola</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-61532</link>
		<dc:creator><![CDATA[Marko Parkkola]]></dc:creator>
		<pubDate>Sat, 20 Feb 2010 18:11:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-61532</guid>
		<description><![CDATA[I wish that people would use version control for SQL stuff also. That way it is always known who has written the script and who has modified it. Here&#039;s how I&#039;ve done it in one of my projects.

You make one centralized database that is used in testing. Then you generate CREATE TABLE scripts for that database and put them into version control. No procedures or functions are done in this step, just the database, tables, views, indexes and constraints.

Now if you have small team working with the project you can create development databases for every team member. If you have many developers in the project, build a team to handle DB stuff and create dev DBs for them.

Every new procedure or function or table or whatever is first implemented to dev DB. When developer wants to get it in testing (s)he commits it to the version control. After that it is run from the version control to the test DB and if possible, with automated scripts to rule out human errors.

All changes goes the same way. First to dev DB, then version control, finally test DB.

Finally production database is build directly from version control.

Currently I&#039;m in a project with some thirty other people where nothing was originally put to version control and DB stuff still isn&#039;t. It&#039;s a nightmare! I don&#039;t know who is responsible of what and from whom I might ask things if something goes wrong.]]></description>
		<content:encoded><![CDATA[<p>I wish that people would use version control for SQL stuff also. That way it is always known who has written the script and who has modified it. Here&#8217;s how I&#8217;ve done it in one of my projects.</p>
<p>You make one centralized database that is used in testing. Then you generate CREATE TABLE scripts for that database and put them into version control. No procedures or functions are done in this step, just the database, tables, views, indexes and constraints.</p>
<p>Now if you have small team working with the project you can create development databases for every team member. If you have many developers in the project, build a team to handle DB stuff and create dev DBs for them.</p>
<p>Every new procedure or function or table or whatever is first implemented to dev DB. When developer wants to get it in testing (s)he commits it to the version control. After that it is run from the version control to the test DB and if possible, with automated scripts to rule out human errors.</p>
<p>All changes goes the same way. First to dev DB, then version control, finally test DB.</p>
<p>Finally production database is build directly from version control.</p>
<p>Currently I&#8217;m in a project with some thirty other people where nothing was originally put to version control and DB stuff still isn&#8217;t. It&#8217;s a nightmare! I don&#8217;t know who is responsible of what and from whom I might ask things if something goes wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-61531</link>
		<dc:creator><![CDATA[Pinal Dave]]></dc:creator>
		<pubDate>Sat, 20 Feb 2010 16:55:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-61531</guid>
		<description><![CDATA[Hello Chaitanya,

The login information of stored any object owner is stored in principle_id columns in sys.objects table. If every developer would login with their own credentials then it would be enough to know the owner but in most cases all developers login with a common shared account. In that case information in principle_id column would not be much useful and you should ask developers to write owner name in comments on the top of sp or other object.

Regards,
Pinal Dave]]></description>
		<content:encoded><![CDATA[<p>Hello Chaitanya,</p>
<p>The login information of stored any object owner is stored in principle_id columns in sys.objects table. If every developer would login with their own credentials then it would be enough to know the owner but in most cases all developers login with a common shared account. In that case information in principle_id column would not be much useful and you should ask developers to write owner name in comments on the top of sp or other object.</p>
<p>Regards,<br />
Pinal Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chaitanya</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-61481</link>
		<dc:creator><![CDATA[chaitanya]]></dc:creator>
		<pubDate>Fri, 19 Feb 2010 13:43:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-61481</guid>
		<description><![CDATA[in my company every developer will write stored procedures and i need to find  stored procedure by whome it is written. is any quary to  find the  stored procedure.
thanks
chaitanya]]></description>
		<content:encoded><![CDATA[<p>in my company every developer will write stored procedures and i need to find  stored procedure by whome it is written. is any quary to  find the  stored procedure.<br />
thanks<br />
chaitanya</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marek Śliwiński</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-48095</link>
		<dc:creator><![CDATA[Marek Śliwiński]]></dc:creator>
		<pubDate>Thu, 05 Mar 2009 10:29:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-48095</guid>
		<description><![CDATA[thx!]]></description>
		<content:encoded><![CDATA[<p>thx!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chanchal Gaud</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-46850</link>
		<dc:creator><![CDATA[Chanchal Gaud]]></dc:creator>
		<pubDate>Wed, 18 Feb 2009 12:01:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-46850</guid>
		<description><![CDATA[select objs.name,* from sys.objects objs
INNER JOIN sys.sql_modules mods on
objs.object_id = mods.object_id
where objs.type = ‘P’
and definition like ‘%your_search_string_here%’

In this case i have your_search_string_here = %
I need those strings which contain the % as string....
example it should give me all the strings like 
&#039;abcd % abcd&#039;,ad%sd&#039; etc.......]]></description>
		<content:encoded><![CDATA[<p>select objs.name,* from sys.objects objs<br />
INNER JOIN sys.sql_modules mods on<br />
objs.object_id = mods.object_id<br />
where objs.type = ‘P’<br />
and definition like ‘%your_search_string_here%’</p>
<p>In this case i have your_search_string_here = %<br />
I need those strings which contain the % as string&#8230;.<br />
example it should give me all the strings like<br />
&#8216;abcd % abcd&#8217;,ad%sd&#8217; etc&#8230;&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-46240</link>
		<dc:creator><![CDATA[Ian]]></dc:creator>
		<pubDate>Mon, 02 Feb 2009 13:55:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-46240</guid>
		<description><![CDATA[Thanks, just what I wanted.

In case you have tables which start with the same name:

SELECT Name
    FROM sys.procedures
    WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE &#039;%Employee%&#039;
	AND NOT OBJECT_DEFINITION(OBJECT_ID) LIKE &#039;%EmployeeDetails%&#039;]]></description>
		<content:encoded><![CDATA[<p>Thanks, just what I wanted.</p>
<p>In case you have tables which start with the same name:</p>
<p>SELECT Name<br />
    FROM sys.procedures<br />
    WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE &#8216;%Employee%&#8217;<br />
	AND NOT OBJECT_DEFINITION(OBJECT_ID) LIKE &#8216;%EmployeeDetails%&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gorcer</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-44093</link>
		<dc:creator><![CDATA[gorcer]]></dc:creator>
		<pubDate>Fri, 07 Nov 2008 05:37:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-44093</guid>
		<description><![CDATA[thank&#039;s!!]]></description>
		<content:encoded><![CDATA[<p>thank&#8217;s!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shishir Khandekar</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-41767</link>
		<dc:creator><![CDATA[Shishir Khandekar]]></dc:creator>
		<pubDate>Mon, 18 Aug 2008 20:00:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-41767</guid>
		<description><![CDATA[If you need a sp_depends alternative (sp_depends does not always work), here&#039;s a crude script. I am selecting all columns but you can trip down as per your needs. This will basically search for a string in an object which is type P, RF, V, TR, FN, IF, TF, and R:

-------
select objs.name,* from sys.objects objs
INNER JOIN sys.sql_modules mods on
objs.object_id = mods.object_id
where objs.type = &#039;P&#039;
and definition like &#039;%your_search_string_here%&#039;
-------

Useful to see which object is referenced by which other object.

-Shishir]]></description>
		<content:encoded><![CDATA[<p>If you need a sp_depends alternative (sp_depends does not always work), here&#8217;s a crude script. I am selecting all columns but you can trip down as per your needs. This will basically search for a string in an object which is type P, RF, V, TR, FN, IF, TF, and R:</p>
<p>&#8212;&#8212;-<br />
select objs.name,* from sys.objects objs<br />
INNER JOIN sys.sql_modules mods on<br />
objs.object_id = mods.object_id<br />
where objs.type = &#8216;P&#8217;<br />
and definition like &#8216;%your_search_string_here%&#8217;<br />
&#8212;&#8212;-</p>
<p>Useful to see which object is referenced by which other object.</p>
<p>-Shishir</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Gonzalez</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-41455</link>
		<dc:creator><![CDATA[Eric Gonzalez]]></dc:creator>
		<pubDate>Thu, 07 Aug 2008 18:48:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-41455</guid>
		<description><![CDATA[This is what I was looking for, thanks

Eric]]></description>
		<content:encoded><![CDATA[<p>This is what I was looking for, thanks</p>
<p>Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre Cornelissen</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-38811</link>
		<dc:creator><![CDATA[Pierre Cornelissen]]></dc:creator>
		<pubDate>Tue, 27 May 2008 07:27:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-38811</guid>
		<description><![CDATA[Thanks, this works very well.  What I would have like is to see is sort of the line numbers associated with the objects, and perhaps a replace script as well.  Any pointers would be welcome.

Pierre]]></description>
		<content:encoded><![CDATA[<p>Thanks, this works very well.  What I would have like is to see is sort of the line numbers associated with the objects, and perhaps a replace script as well.  Any pointers would be welcome.</p>
<p>Pierre</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aarthi</title>
		<link>http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-37952</link>
		<dc:creator><![CDATA[Aarthi]]></dc:creator>
		<pubDate>Tue, 13 May 2008 17:41:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/11/10/sql-server-2005-2000-search-string-in-stored-procedure/#comment-37952</guid>
		<description><![CDATA[Thanks..worked like a charm!]]></description>
		<content:encoded><![CDATA[<p>Thanks..worked like a charm!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

