{"id":1416,"date":"2013-10-30T08:57:56","date_gmt":"2013-10-30T02:57:56","guid":{"rendered":"http:\/\/techsatwork.com\/blog\/?p=1416"},"modified":"2016-01-07T11:31:03","modified_gmt":"2016-01-07T05:31:03","slug":"search-keyword-sql-server-objects","status":"publish","type":"post","link":"https:\/\/techsatwork.com\/?p=1416","title":{"rendered":"Search for keyword in SQL Server Objects"},"content":{"rendered":"<p>Have you ever had to search for some keyword in a database object code. Here is a piece of sql that will search through the database (not data) for a keyboard :<\/p>\n<p>select DISTINCT \u00c2\u00a0a.name<br \/>\nfrom sysobjects a (NOLOCK)<br \/>\njoin syscomments b (NOLOCK) ON a.id = b.id<br \/>\nwhere a.type IN (&#8216;P&#8217;, &#8216;TR&#8217;, &#8216;V&#8217;, &#8216;FN&#8217;)<br \/>\nand b.text LIKE &#8216;%cursor%&#8217;<\/p>\n<p>This will search through stored procedures, triggers, views and functions defined on the database for the word &#8216;cursor&#8217;.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever had to search for some keyword in a database object code. Here is a piece of sql that will search through the database (not data) for a keyboard : select DISTINCT \u00c2\u00a0a.name from sysobjects a (NOLOCK) join syscomments b (NOLOCK) ON a.id = b.id where a.type IN (&#8216;P&#8217;, &#8216;TR&#8217;, &#8216;V&#8217;, &#8216;FN&#8217;) and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","site-transparent-header":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[658],"tags":[860,861,859,858,862],"class_list":["post-1416","post","type-post","status-publish","format-standard","hentry","category-sql-server-2","tag-find-a-word","tag-occurrence-of-a-word","tag-search-for-keyword","tag-sql-server-search","tag-sys-objects"],"_links":{"self":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts\/1416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1416"}],"version-history":[{"count":1,"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts\/1416\/revisions"}],"predecessor-version":[{"id":1417,"href":"https:\/\/techsatwork.com\/index.php?rest_route=\/wp\/v2\/posts\/1416\/revisions\/1417"}],"wp:attachment":[{"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techsatwork.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}