{"id":28952,"date":"2023-10-02T06:16:00","date_gmt":"2023-10-02T04:16:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=28952"},"modified":"2023-11-10T20:45:25","modified_gmt":"2023-11-10T19:45:25","slug":"search-text-in-sql-stored-procedure","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/","title":{"rendered":"How to search text in a stored procedure with SQL Server ?"},"content":{"rendered":"\n<p><strong><em>Tutorial with T-SQL script examples to search for text inside one SQL Server Stored Procedure or multiple ones at the same time.<\/em><\/strong><\/p>\n\n\n\n<p>In the world of database management, SQL Server stored procedures are a cornerstone. They encapsulate complex logic, improve performance, and enhance security. However, managing and navigating through numerous stored procedures can be challenging, especially when searching for specific text or code segments. This guide will walk you through the best practices for effectively searching text within SQL Server stored procedures.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#1-understanding-sql-server-stored-procedures\" >1. Understanding SQL Server stored procedures<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#2-search-and-find-specific-text-in-sql-server-procedure\" >2. Search and find specific text in SQL Server procedure<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#3-count-occurrences-of-a-text-in-a-procedure\" >3. Count occurrences of a text in a procedure<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#4-best-practices-for-search-in-sql-procedures\" >4. Best practices for search in SQL procedures<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#5-common-challenges-and-solutions\" >5. Common challenges and solutions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#6-search-for-text-helps-in-t-sql-development\" >6. Search for text helps in T-SQL development<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-1-understanding-sql-server-stored-procedures\"><span class=\"ez-toc-section\" id=\"1-understanding-sql-server-stored-procedures\"><\/span><strong>1. Understanding SQL Server stored procedures<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-is-a-sql-server-stored-procedure\">What is a SQL Server stored procedure?<\/h3>\n\n\n\n<p>A <a href=\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure-parameters\/\">SQL stored procedure<\/a> is a set of SQL queries that are compiled and stored in the database. These pre-written SQL statements are used to perform complex operations, ensuring efficiency and security.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-benefits-of-sql-server-stored-procedure\">Benefits of SQL Server stored procedure<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Improved performance<\/li>\n\n\n\n<li>Reduced network traffic<\/li>\n\n\n\n<li>Enhanced security<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-2-search-and-find-specific-text-in-sql-server-procedure\"><span class=\"ez-toc-section\" id=\"2-search-and-find-specific-text-in-sql-server-procedure\"><\/span><strong>2. Search and find specific text in SQL Server procedure<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-video-about-the-3-queries-to-search-and-find-text-in-a-procedure\"><em>Video about the 3 queries to search and find text in a procedure<\/em><\/h4>\n\n\n\n<div style=\"text-align: center;\"><iframe loading=\"lazy\" width=\"426\" height=\"240\" src=\"https:\/\/www.youtube.com\/embed\/FwZ85uw5COc?si=gd56kZHliZZN6M8i&amp;controls=0\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-query-to-search-text-in-a-stored-procedure-with-sql-server\">Query to search text in a stored procedure with SQL Server<\/h3>\n\n\n\n<p>For more advanced searches, and this is definitely the one I recommend for efficiency, use T-SQL queries. Here&#8217;s a basic script to get started:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT  ROUTINE_SCHEMA,\n        ROUTINE_NAME,\n        ROUTINE_DEFINITION\nFROM    INFORMATION_SCHEMA.ROUTINES\nWHERE   ROUTINE_TYPE='PROCEDURE'\n  AND   ROUTINE_DEFINITION LIKE '%YourSearchText%'\nORDER BY 1;\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-filter-the-text-search-to-one-sql-stored-procedure\">Filter the text search to one SQL stored procedure<\/h3>\n\n\n\n<p>If you want to search only in one specific procedure and do not want to have a long list of procedures displayed, for example on large projects, you can add a filter. <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT OBJECT_NAME(object_id) AS ProcedureName\nFROM   sys.sql_modules\nWHERE  OBJECT_NAME(object_id) = 'uspInsertCustomer'\nAND    definition LIKE '%YourSearchText%';\n<\/pre>\n\n\n\n<p>This SQL script perform these 2 main actions:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Filter by Stored Procedure Name:<\/strong> It specifically looks for the <em>uspListSales<\/em> stored procedure.<\/li>\n\n\n\n<li><strong>Search for the Text:<\/strong> It searches for occurrences of <em>YourSearchText<\/em> within the procedure&#8217;s code.<\/li>\n<\/ol>\n\n\n\n<p>Of course, you need to replace<em> <em>YourSearchText<\/em> <\/em> with the actual text you&#8217;re searching for in the <code>uspListSales<\/code> stored procedure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-use-third-party-tools-to-find-a-specific-text\">Use third-party tools to find a specific text <\/h3>\n\n\n\n<p>Several third-party tools offer extended capabilities for searching within stored procedures. Tools like <a href=\"https:\/\/www.red-gate.com\/products\/sql-search\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">RedGate SQL Search<\/a> can be valuable for more complex search requirements.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-ssms-gui-allow-only-search-in-names\">SSMS GUI allow only search in names<\/h3>\n\n\n\n<p>SQL Server Management Studio offers an intuitive GUI interface for navigating and managing your SQL Server instances. To search for a stored procedure name, <em>not in the code<\/em>, follow the 4 simple steps explained below:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Open SSMS<\/strong><\/li>\n\n\n\n<li><strong>Connect<\/strong> to your database.<\/li>\n\n\n\n<li>Navigate to the <strong><em>Object Explorer<\/em><\/strong>, then expand <strong>your database<\/strong>, Select <strong><em>Programmability<\/em><\/strong><\/li>\n\n\n\n<li>Then Right-click on <strong><em>Stored Procedures<\/em><\/strong><\/li>\n\n\n\n<li>Then chose <strong><em>Filter<\/em><\/strong>, and <strong><em>Filter Settings<\/em><\/strong><\/li>\n\n\n\n<li><strong>Enter the text or phrase<\/strong> you are looking for in the Value column.<\/li>\n<\/ol>\n\n\n\n<p>Using the SSMS GUI, it is only possible to filter by <em><strong>Name<\/strong><\/em>, <strong><em>Schema<\/em> <\/strong>and <em><strong>Owner<\/strong><\/em>, and also using the Is <em>Natively Compiled<\/em> and the <em>Creation Date<\/em> properties.<\/p>\n\n\n\n<p>Nevertheless, this option is very useful when developing and you do not want to see dozen of stored procedures in the list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3-count-occurrences-of-a-text-in-a-procedure\"><\/span><strong>3. Count occurrences of a text in a procedure<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Using SQL queries to count text occurrences<\/h3>\n\n\n\n<p>In addition to locating specific text, you may also need to count how often a particular string appears within your stored procedures. This can be particularly useful for assessing the usage of certain functions, variables, or patterns within your database code.<\/p>\n\n\n\n<p>To achieve this, you can use a combination of SQL queries and string functions. Here&#8217;s an example SQL query that counts the number of occurrences of a specific text within all stored procedures:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT OBJECT_NAME(object_id), \n       (LEN(definition) - LEN(REPLACE(definition, 'your_search_text', ''))) \/ LEN('your_search_text') AS OccurrenceCount\nFROM sys.sql_modules\nWHERE definition LIKE '%your_search_text%'\n<\/pre>\n\n\n\n<p>This query works by calculating the difference in length between the original definition and the definition after removing the search text. This difference, divided by the length of the search text, gives the count of how many times the text appears in each stored procedure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Practical applications<\/h3>\n\n\n\n<p>Such a query is particularly useful in large databases where you need to quantify the use of certain practices, deprecated functions, or any specific patterns within your SQL code. It helps in making informed decisions about refactoring, updating, or optimizing stored procedures.<\/p>\n\n\n\n<p>A typical use case would be to <strong>implement TRY CATCH logic in all your stored procedure inserts<\/strong>. And you need first to do an audit to check how much stored procedures perform INSERT statements and how much already have a TRY CATCH block. And then check the code after implementation to count the updated procedures.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-4-best-practices-for-search-in-sql-procedures\"><span class=\"ez-toc-section\" id=\"4-best-practices-for-search-in-sql-procedures\"><\/span><strong>4. Best practices for search in SQL procedures<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-use-regular-expression\">Use regular expression<\/h3>\n\n\n\n<p>Incorporate regular expressions in your search queries for more refined results, especially when searching for patterns rather than exact text.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-organize-sql-stored-procedures\">Organize SQL stored procedures<\/h3>\n\n\n\n<p>Adopt a naming convention and organize stored procedures logically. This practice can simplify the search process, especially in large databases.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-comment-and-document-sql-server-code\">Comment and document SQL Server code<\/h3>\n\n\n\n<p>Maintain comprehensive comments and documentation within your stored procedures. This approach not only aids in searching but also enhances overall maintenance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-5-common-challenges-and-solutions\"><span class=\"ez-toc-section\" id=\"5-common-challenges-and-solutions\"><\/span><strong>5. Common challenges and solutions<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-dealing-with-large-databases\">Dealing with Large Databases<\/h3>\n\n\n\n<p>In databases with a vast number of stored procedures, optimize your search queries for performance. Utilize indexes and full-text search capabilities.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-case-sensitivity-issues\">Case Sensitivity Issues<\/h3>\n\n\n\n<p>SQL Server can be <a href=\"https:\/\/learn.microsoft.com\/en-us\/ef\/core\/miscellaneous\/collations-and-case-sensitivity\" target=\"_blank\" rel=\"noreferrer noopener\">case sensitive<\/a> based on the collation settings. Be mindful of this when performing searches and use appropriate collation settings if necessary.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-avoid-common-pitfalls\">Avoid Common Pitfalls<\/h3>\n\n\n\n<p>Avoid overly broad searches that return too many results. Be as specific as possible in your search criteria to get relevant results quickly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-6-search-for-text-helps-in-t-sql-development\"><span class=\"ez-toc-section\" id=\"6-search-for-text-helps-in-t-sql-development\"><\/span><strong>6. Search for text helps in T-SQL development<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Searching for text in SQL Server stored procedures can be streamlined with the right techniques and tools. By understanding the basics of stored procedures and employing efficient search strategies, you can quickly navigate and manage your SQL codebase.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Tutorial with T-SQL script examples to search for text inside one SQL Server Stored Procedure or multiple ones at the same time. In the world of database management, SQL Server stored procedures are a cornerstone. They encapsulate complex logic, <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/\" title=\"How to search text in a stored procedure with SQL Server ?\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":29003,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[454],"tags":[],"class_list":{"0":"post-28952","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-t-sql"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.7 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to search text in a stored procedure with SQL Server ? T-SQL<\/title>\n<meta name=\"description\" content=\"Learn how to search for a text within SQL Server stored procedure, and learn tips and tricks for efficient T-SQL search techniques.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to search text in a stored procedure with SQL Server ?\" \/>\n<meta property=\"og:description\" content=\"Learn how to search for a text within SQL Server stored procedure, and learn tips and tricks for efficient T-SQL search techniques.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL and IT Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-02T04:16:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-10T19:45:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2023\/10\/search-text-stored-procedure_1280_720.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Expert-Only\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@expert_only\" \/>\n<meta name=\"twitter:site\" content=\"@expert_only\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Expert-Only\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\"},\"headline\":\"How to search text in a stored procedure with SQL Server ?\",\"datePublished\":\"2023-10-02T04:16:00+00:00\",\"dateModified\":\"2023-11-10T19:45:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/\"},\"wordCount\":908,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2023\/10\/search-text-stored-procedure_1280_720.jpg\",\"articleSection\":[\"T-SQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/\",\"url\":\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/\",\"name\":\"How to search text in a stored procedure with SQL Server ? T-SQL\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2023\/10\/search-text-stored-procedure_1280_720.jpg\",\"datePublished\":\"2023-10-02T04:16:00+00:00\",\"dateModified\":\"2023-11-10T19:45:25+00:00\",\"description\":\"Learn how to search for a text within SQL Server stored procedure, and learn tips and tricks for efficient T-SQL search techniques.\",\"breadcrumb\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#primaryimage\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2023\/10\/search-text-stored-procedure_1280_720.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2023\/10\/search-text-stored-procedure_1280_720.jpg\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\/\/expert-only.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to search text in a stored procedure with SQL Server ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/expert-only.com\/en\/#website\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"name\":\"SQL and IT Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/expert-only.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/expert-only.com\/en\/#organization\",\"name\":\"Expert-Only\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"width\":381,\"height\":174,\"caption\":\"Expert-Only\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\",\"https:\/\/x.com\/expert_only\",\"https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\",\"name\":\"Expert-Only\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"caption\":\"Expert-Only\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to search text in a stored procedure with SQL Server ? T-SQL","description":"Learn how to search for a text within SQL Server stored procedure, and learn tips and tricks for efficient T-SQL search techniques.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/","og_locale":"en_US","og_type":"article","og_title":"How to search text in a stored procedure with SQL Server ?","og_description":"Learn how to search for a text within SQL Server stored procedure, and learn tips and tricks for efficient T-SQL search techniques.","og_url":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2023-10-02T04:16:00+00:00","article_modified_time":"2023-11-10T19:45:25+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2023\/10\/search-text-stored-procedure_1280_720.jpg","type":"image\/jpeg"}],"author":"Expert-Only","twitter_card":"summary_large_image","twitter_creator":"@expert_only","twitter_site":"@expert_only","twitter_misc":{"Written by":"Expert-Only","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"How to search text in a stored procedure with SQL Server ?","datePublished":"2023-10-02T04:16:00+00:00","dateModified":"2023-11-10T19:45:25+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/"},"wordCount":908,"commentCount":0,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2023\/10\/search-text-stored-procedure_1280_720.jpg","articleSection":["T-SQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/","url":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/","name":"How to search text in a stored procedure with SQL Server ? T-SQL","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2023\/10\/search-text-stored-procedure_1280_720.jpg","datePublished":"2023-10-02T04:16:00+00:00","dateModified":"2023-11-10T19:45:25+00:00","description":"Learn how to search for a text within SQL Server stored procedure, and learn tips and tricks for efficient T-SQL search techniques.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2023\/10\/search-text-stored-procedure_1280_720.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2023\/10\/search-text-stored-procedure_1280_720.jpg","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/t-sql\/search-text-in-sql-stored-procedure\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"How to search text in a stored procedure with SQL Server ?"}]},{"@type":"WebSite","@id":"https:\/\/expert-only.com\/en\/#website","url":"https:\/\/expert-only.com\/en\/","name":"SQL and IT Tutorials","description":"","publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/expert-only.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/expert-only.com\/en\/#organization","name":"Expert-Only","url":"https:\/\/expert-only.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","width":381,"height":174,"caption":"Expert-Only"},"image":{"@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ExpertOnlyCom\/","https:\/\/x.com\/expert_only","https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA"]},{"@type":"Person","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef","name":"Expert-Only","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","caption":"Expert-Only"}}]}},"_links":{"self":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/28952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/comments?post=28952"}],"version-history":[{"count":37,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/28952\/revisions"}],"predecessor-version":[{"id":29030,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/28952\/revisions\/29030"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/29003"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=28952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=28952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=28952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}