﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Laurent Michaud  / Find a string in database objects / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 21:54:28 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Find a string in database objects</title><link>http://www.sqlservercentral.com/Forums/Topic929416-2703-1.aspx</link><description>Nice script and great tip on doing the left join to get table info.[code="other"]SELECT	DISTINCT	TypeDescription,	SchemaName,	Name,	'...' + SUBSTRING(t.ObjectDefinition,	CHARINDEX(@chvStringToFind,	t.ObjectDefinition)	- @intNbCharToExtract,	LEN(@chvStringToFind)	+ ( @intNbCharToExtract * 2 )) + '...' AS Extract,	CreationDate,	ModificationDate	FROM (	SELECT DISTINCT		o.name AS Name,		SCHEMA_NAME (o.schema_id) AS SchemaName,		o.type_desc AS TypeDescription,		o.create_date AS CreationDate,		o.modify_date AS ModificationDate,		ISNULL(OBJECT_DEFINITION(object_id), c.name) AS ObjectDefinition	FROM sys.objects o WITH (NOLOCK)	LEFT OUTER JOIN syscolumns c		ON c.id = o.object_id	WHERE  		--( 		--	( o.type IN ( 'AF', 'FN', 'IF', 'P', 'TF', 'TT', 'U', 'V', 'X' )		--	AND @chrObjectType IS NULL		--	)		--	OR o.type = @chrObjectType		--)		(o.type = @chrObjectType OR @chrObjectType IS NULL)		AND (OBJECT_DEFINITION(o.object_id) LIKE '%' + @chvStringToFind + '%'			OR			c.name LIKE '%' + @chvStringToFind + '%'			)	) AS tORDER BY 	1,	2,	3,	4,	5,	6[/code]</description><pubDate>Fri, 22 Jun 2012 08:54:30 GMT</pubDate><dc:creator>Kevin Kennedy</dc:creator></item><item><title>RE: Find a string in database objects</title><link>http://www.sqlservercentral.com/Forums/Topic929416-2703-1.aspx</link><description>I think mine works better:http://www.sqlservercentral.com/scripts/Search/64839/It hits all databases and includes job steps.</description><pubDate>Mon, 21 Jun 2010 17:16:22 GMT</pubDate><dc:creator>David Korb</dc:creator></item><item><title>RE: Find a string in database objects</title><link>http://www.sqlservercentral.com/Forums/Topic929416-2703-1.aspx</link><description>I wasn't seeing any tables in my results.  I think you need a left outer join to sys_columns because Object_Definition on Table  returns NULL</description><pubDate>Mon, 21 Jun 2010 05:17:55 GMT</pubDate><dc:creator>Jason Akin</dc:creator></item><item><title>Find a string in database objects</title><link>http://www.sqlservercentral.com/Forums/Topic929416-2703-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/String+Match/70371/"&gt;Find a string in database objects&lt;/A&gt;[/B]</description><pubDate>Thu, 27 May 2010 20:26:00 GMT</pubDate><dc:creator>Laurent Michaud</dc:creator></item></channel></rss>