﻿<?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 wfvdijk  / Search in your T-SQL 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:59:34 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Search in your T-SQL objects</title><link>http://www.sqlservercentral.com/Forums/Topic806500-1009-1.aspx</link><description>Thanks rVadim,I changed the ??? to blanks and the script works for me.declare @SearchCriteria nvarchar(100)set @SearchCriteria = '%MEAG_MASTER%' ---------&amp;gt; enter criteria hereselect distinct 	 @SearchCriteria as ZoekCriteria	 , 'in code' as Classification	 , b.type_desc	 , object_name(a.id) "ObjectName" 	 , b.modify_datefrom syscomments ainner join sys.objects b	on a.id = b.object_idwhere a.encrypted = 0	and a.text like @SearchCriteriaunionselect @SearchCriteria	 , 'in code' as Classification	 , 'SYNONYM'	 , name	 , modify_datefrom sys.synonymswhere base_object_name like @SearchCriteriaunionselect @SearchCriteria	 , 'in code' as Classification	 , 'CHECK_CONSTRAINT'	 , name 	 , modify_datefrom sys.check_constraintswhere definition like @SearchCriteriaunionselect @SearchCriteria	 , 'in code' as Classification	 , 'DEFAULT_CONSTRAINT'	 , name 	 , modify_datefrom sys.default_constraintswhere definition like @SearchCriteriaunionselect @SearchCriteria	 , 'as columnname' as Classification	 , 'COLUMN'	 , object_name(object_id) collate database_default	 , NULLfrom sys.columns where name like @SearchCriteriaunionselect @SearchCriteria	 , 'in objectname' as Classification	 , type_desc collate database_default	 , name collate database_default	 , modify_datefrom sys.objects where name like @SearchCriteriaorder by 1,2;</description><pubDate>Mon, 16 Nov 2009 12:22:02 GMT</pubDate><dc:creator>JStiney</dc:creator></item><item><title>RE: Search in your T-SQL objects</title><link>http://www.sqlservercentral.com/Forums/Topic806500-1009-1.aspx</link><description>I've got that error too. When pasted in Notepad++ it looks like this:select????distinct ????????@SearchCriteria as ZoekCriteria????????, 'in code' as Classification????????, b.type_desc????????, object_name(a.id) "ObjectName" ????????, b.modify_datefrom????syscomments ainner????join sys.objects bon????????a.id = b.object_idwhere????a.encrypted = 0and????????a.text like @SearchCriteria--Vadim.</description><pubDate>Mon, 16 Nov 2009 11:50:35 GMT</pubDate><dc:creator>rVadim</dc:creator></item><item><title>RE: Search in your T-SQL objects</title><link>http://www.sqlservercentral.com/Forums/Topic806500-1009-1.aspx</link><description>Wilfred,I get the following message on the select statement when I inserted set @SearchCriteria = '%MEAG_MASTER%' and executed the script.Any suggestions?Msg 170, Level 15, State 1, Line 5Line 5: Incorrect syntax near ' '.Line 5 is the select.</description><pubDate>Mon, 16 Nov 2009 10:09:37 GMT</pubDate><dc:creator>JStiney</dc:creator></item><item><title>Search in your T-SQL objects</title><link>http://www.sqlservercentral.com/Forums/Topic806500-1009-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/Search/68534/"&gt;Search in your T-SQL objects&lt;/A&gt;[/B]</description><pubDate>Wed, 21 Oct 2009 07:48:44 GMT</pubDate><dc:creator>Wilfred van Dijk</dc:creator></item></channel></rss>