{"id":8804,"date":"2023-11-17T06:36:00","date_gmt":"2023-11-17T05:36:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=8804"},"modified":"2023-11-22T18:25:48","modified_gmt":"2023-11-22T17:25:48","slug":"sql-server-stored-procedure","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/","title":{"rendered":"How to create a SQL Server stored procedure ?"},"content":{"rendered":"\n<h4 class=\"wp-block-heading has-text-align-left\" id=\"h-t-sql-tutorial-on-how-to-create-and-run-basic-sql-server-stored-procedures\"><em>T-SQL tutorial on how to create and run basic SQL Server stored procedures.<\/em><\/h4>\n\n\n\n<p>To create a simple SQL Server stored procedure, use the CREATE statement. A SQL Procedure is nothing more than T-SQL code stored in a way that can be easily reused. In this short SQL Server tutorial here is how to write and use a simple stored procedure in Transact-SQL to select data from a table.<\/p>\n\n\n\n<p>Before creating a stored procedure, you need to know what the end result will be. In other words, is the purpose to display data, insert data for example. Or it can be to update existing data, but it is also possible to delete data. That is to say, all Data Manipulation Language (DML) commands. And of course to combine several operations. Like for example calling one or more other procedures. This is called nested procedures.<\/p>\n\n\n\n<p>On the other hand, all SQL object manipulation commands are also possible. That is to say all the commands known as Data Definition Language (DDL).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-1-select-data-using-a-sql-stored-procedure\">1. Select data using a SQL stored procedure<\/h2>\n\n\n\n<p>The purpose of this example is to select all the data of the customer table stored in the database. The table is in the default schema dbo, for Database Owner. Thus, the following T-SQL code returns all rows of this table.<\/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 *\nFROM   dbo.CLIENTS;\n<\/pre>\n\n\n\n<p>The code to create the clients table is available in this post about <strong><a href=\"https:\/\/expert-only.com\/en\/t-sql\/manage-sql-server-tables\/\">how to create and manage SQL Server tables<\/a><\/strong>.<\/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=\"\">-- Create the Clients table\nCREATE TABLE [dbo].[CLIENTS] (\n   [CLIENTID] int IDENTITY(1,1),\n   [NAME] nvarchar(20) UNIQUE,\n   [CITY] nvarchar(20)\n)\nGO\n\n-- Insert data for the example\nINSERT INTO dbo.CLIENTS (NAME, CITY) VALUES ('MAMMADOU', 'Lyon');\nINSERT INTO dbo.CLIENTS (NAME, CITY) VALUES ('SERGEI', 'Lyon');\nINSERT INTO dbo.CLIENTS (NAME, CITY) VALUES ('CHRISTOPHE', 'Paris');\n\n-- Check inserted rows\nSELECT *\nFROM   dbo.CLIENTS;\n<\/pre>\n\n\n\n<p>To create a simple stored procedure, use this code for example. Simply use the CREATE PROCEDURE or CREATE PROC command. After the name of the stored procedure, use the keyword &#8220;AS&#8221;. The rest is just standard T-SQL code to execute.<\/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=\"\">CREATE PROCEDURE uspClientsList\nAS\n   SELECT *\n   FROM dbo.CLIENTS\nGO\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-2-example-script-to-execute-a-t-sql-procedure\">2. Example script to execute a T-SQL procedure<\/h2>\n\n\n\n<p>To execute the stored procedure and display the contents of the Customers <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/t-sql\/data-types\/table-transact-sql?view=sql-server-ver16\" target=\"_blank\" rel=\"noreferrer noopener\">table<\/a> specified in the query, simply execute the following code:<\/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=\"\">EXECUTE dbo.uspListeClients;\nGO\n\n-- Or\nEXEC dbo.uspClientsList;\nGO\n\n-- Or simply\nuspClientsList;\nGO\n<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"579\" height=\"592\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/creer_executer_procedure_stockee_simple.png\" alt=\"Create a SQL Server stored procedure to select data from a table\" class=\"wp-image-4597\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/creer_executer_procedure_stockee_simple.png 579w, https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/creer_executer_procedure_stockee_simple-293x300.png 293w\" sizes=\"auto, (max-width: 579px) 100vw, 579px\" \/><figcaption class=\"wp-element-caption\"><em>Create a SQL Server stored procedure to select data from a table<\/em><\/figcaption><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-3-two-things-to-know-about-t-sql-stored-procedures\">3. Two things to know about T-SQL stored procedures<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, do not use the &#8220;GO&#8221; keyword inside the stored procedure. This is because once the SQL Server compiler encounters &#8220;GO&#8221; it assumes that this is the end of the stored procedure.<\/li>\n\n\n\n<li>Finally, do not change the database inside the stored procedure. Either using the &#8220;USE AnotherBase&#8221; command for example does not work.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-t-sql-stored-procedures-are-widely-used\">T-SQL stored procedures are widely used<\/h3>\n\n\n\n<p>In this tutorial, we learned how to <strong>create a basic SQL Server stored procedure<\/strong> using the CREATE statement, which helps store T-SQL code for easy reuse. We covered the process of defining the end result, incorporating Data Manipulation Language (DML) commands, and executing the stored procedure with the example code.<\/p>\n\n\n\n<p>We also highlighted a few essential aspects to consider, such as not using the <strong><em>GO<\/em><\/strong> keyword inside the stored procedure and avoiding database changes inside the procedure code.<\/p>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1658050173638\"><strong class=\"schema-faq-question\">What is a SQL Server stored procedure?<\/strong> <p class=\"schema-faq-answer\">A SQL Server stored procedure is a script written in Transact-SQL (T-SQL) and executed in a database. A procedure groups one or more SQL statements. It can handle input parameters and output parameters. The steps are repeated each time a stored procedure is called.<\/p> <\/div> <\/div>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-wp-embed is-provider-sql-and-it-tutorials wp-block-embed-sql-and-it-tutorials\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/expert-only.com\/en\/t-sql\/sql-server-pivot-query-example\/\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>T-SQL tutorial on how to create and run basic SQL Server stored procedures. To create a simple SQL Server stored procedure, use the CREATE statement. A SQL Procedure is nothing more than T-SQL code stored in a way that <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/\" title=\"How to create a SQL Server stored procedure ?\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":5543,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[454],"tags":[],"class_list":{"0":"post-8804","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 create a SQL Server stored procedure ? T-SQL<\/title>\n<meta name=\"description\" content=\"To create and execute a SQL Server stored procedure, copy this T-SQL example code and adapt the SQL select statements.\" \/>\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\/sql-server-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 create a SQL Server stored procedure ?\" \/>\n<meta property=\"og:description\" content=\"To create and execute a SQL Server stored procedure, copy this T-SQL example code and adapt the SQL select statements.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-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-11-17T05:36:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-22T17:25:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/problem-1951987_1920.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\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=\"3 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\/sql-server-stored-procedure\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\"},\"headline\":\"How to create a SQL Server stored procedure ?\",\"datePublished\":\"2023-11-17T05:36:00+00:00\",\"dateModified\":\"2023-11-22T17:25:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/\"},\"wordCount\":528,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/problem-1951987_1920.jpg\",\"articleSection\":[\"T-SQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/\",\"url\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/\",\"name\":\"How to create a SQL Server stored procedure ? T-SQL\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/problem-1951987_1920.jpg\",\"datePublished\":\"2023-11-17T05:36:00+00:00\",\"dateModified\":\"2023-11-22T17:25:48+00:00\",\"description\":\"To create and execute a SQL Server stored procedure, copy this T-SQL example code and adapt the SQL select statements.\",\"breadcrumb\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#faq-question-1658050173638\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#primaryimage\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/problem-1951987_1920.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/problem-1951987_1920.jpg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\/\/expert-only.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to create a SQL Server stored procedure ?\"}]},{\"@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\"}},{\"@type\":\"Question\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#faq-question-1658050173638\",\"position\":1,\"url\":\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#faq-question-1658050173638\",\"name\":\"What is a SQL Server stored procedure?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"A SQL Server stored procedure is a script written in Transact-SQL (T-SQL) and executed in a database. A procedure groups one or more SQL statements. It can handle input parameters and output parameters. The steps are repeated each time a stored procedure is called.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to create a SQL Server stored procedure ? T-SQL","description":"To create and execute a SQL Server stored procedure, copy this T-SQL example code and adapt the SQL select statements.","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\/sql-server-stored-procedure\/","og_locale":"en_US","og_type":"article","og_title":"How to create a SQL Server stored procedure ?","og_description":"To create and execute a SQL Server stored procedure, copy this T-SQL example code and adapt the SQL select statements.","og_url":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2023-11-17T05:36:00+00:00","article_modified_time":"2023-11-22T17:25:48+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/problem-1951987_1920.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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"How to create a SQL Server stored procedure ?","datePublished":"2023-11-17T05:36:00+00:00","dateModified":"2023-11-22T17:25:48+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/"},"wordCount":528,"commentCount":0,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/problem-1951987_1920.jpg","articleSection":["T-SQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/","url":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/","name":"How to create a SQL Server stored procedure ? T-SQL","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/problem-1951987_1920.jpg","datePublished":"2023-11-17T05:36:00+00:00","dateModified":"2023-11-22T17:25:48+00:00","description":"To create and execute a SQL Server stored procedure, copy this T-SQL example code and adapt the SQL select statements.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#faq-question-1658050173638"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/problem-1951987_1920.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/problem-1951987_1920.jpg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"How to create a SQL Server stored procedure ?"}]},{"@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"}},{"@type":"Question","@id":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#faq-question-1658050173638","position":1,"url":"https:\/\/expert-only.com\/en\/t-sql\/sql-server-stored-procedure\/#faq-question-1658050173638","name":"What is a SQL Server stored procedure?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"A SQL Server stored procedure is a script written in Transact-SQL (T-SQL) and executed in a database. A procedure groups one or more SQL statements. It can handle input parameters and output parameters. The steps are repeated each time a stored procedure is called.","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/8804","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=8804"}],"version-history":[{"count":7,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/8804\/revisions"}],"predecessor-version":[{"id":29310,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/8804\/revisions\/29310"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/5543"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=8804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=8804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=8804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}