{"id":961,"date":"2012-05-13T17:04:46","date_gmt":"2012-05-13T21:04:46","guid":{"rendered":"http:\/\/sqlity.net\/en\/?p=961"},"modified":"2014-11-13T13:57:50","modified_gmt":"2014-11-13T18:57:50","slug":"the-mysterious-sp_-system-procedure-prefix","status":"publish","type":"post","link":"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/","title":{"rendered":"The Mysterious &#8220;sp_&#8221; System Procedure Prefix"},"content":{"rendered":"<div>\n<h3>Introduction<\/h3>\n<p>\nIf you have been working with SQL Server for a while you probably know that you should not select names for your stored procedures that start with the three characters \"sp_\".\n<\/p>\n<p>\nToday I would like to take a closer look at all the myths and facts around this prefix. This will include a series of examples, all of which have been tested on SQL 2008R2 and on SQL 2012.\n<\/p>\n<h3>Special Objects<\/h3>\n<p>\nThe first myth I would like to bust is that the \"sp_\" prefix stands for \"system procedure\".\n<\/p>\n<p>\nWhile the BOL entry for <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms190669(v=sql.105).aspx\">Creating Stored Procedures<\/a> uses language that could easily be interpreted like that, it actually never says anything about the etymology of this prefix. In fact, the \"sp_\" prefix causes a special path to be taken in the resolution of the object name. This works for stored procedures as well as for other object types. Later on this article contains an example with a table.\n<\/p>\n<p>\nAs \"sp_\" designates more objects than just stored procedures as special, it clearly does not mean \"System Procedure\", even though it currently is only used for system procedures. Instead it just stands for \"special\".\n<\/p>\n<h3>Resource Database<\/h3>\n<p>\nThe idea for this article came from a tweet in a discussion about this prefix started by @ericstephani. In the tweet in question @SirSQL suggested to check if <span class=\"tt\">master<\/span> was indeed the database checked first, as everyone in the discussion had assumed before, or if it rather is the resource database. This makes a lot of sense, as most of the system objects live in the resource database. So I decided to check this out by running a series of tests.\n<\/p>\n<p>\nIf you want to follow along with these tests you will need two databases: One with the name <span class=\"tt\">test<\/span> and one that is called <span class=\"tt\">OtherDb<\/span>.\n<\/p>\n<p>\nFor the first test I created a procedure with the name <span class=\"tt\">sp_executesql<\/span> in <span class=\"tt\">master<\/span> as well as in <span class=\"tt\">test<\/span> and then executed it from both places:\n<\/p>\n<div>\n[sql]\nUSE master;<br \/>\nGO<br \/>\nCREATE PROCEDURE dbo.sp_executesql<br \/>\n@statement NVARCHAR(MAX)<br \/>\nAS<br \/>\nBEGIN<br \/>\n  SELECT DB_NAME() [called from], 'master' [sp_executesql];<br \/>\nEND<br \/>\nGO<br \/>\nEXEC dbo.sp_executesql @statement = N'SELECT DB_NAME() [called from], ''system'' [sp_executesql];';<br \/>\nGO<br \/>\nDROP PROCEDURE dbo.sp_executesql;<br \/>\nGO<br \/>\n------------------------------------------------<br \/>\nGO<br \/>\nUSE test;<br \/>\nGO<br \/>\nCREATE PROCEDURE dbo.sp_executesql<br \/>\n@statement NVARCHAR(MAX)<br \/>\nAS<br \/>\nBEGIN<br \/>\n  SELECT DB_NAME() [called from], 'test' [sp_executesql];<br \/>\nEND<br \/>\nGO<br \/>\nEXEC dbo.sp_executesql @statement = N'SELECT DB_NAME() [called from], ''system'' [sp_executesql];';<br \/>\nGO<br \/>\nDROP PROCEDURE dbo.sp_executesql;<br \/>\nGO<br \/>\n[\/sql]\n<\/div>\n<p>\nThe <span class=\"tt\">sp_executesql<\/span> version that gets shipped with SQL Server lives in the resource database and so we would expect this version to get executed in all cases. This is indeed correct, as you can see in the result:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_executesql_test_results.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_executesql_test_results.png\" alt=\"sp_executesql test results\" title=\"sp_executesql test results\" width=\"194\" height=\"109\" class=\"aligncenter size-full wp-image-965\" \/><\/a>\n<\/p>\n<p>\nThe above test shows that the resource database is checked first when an object name with the \"sp_\" prefix is encountered. That means that if you create any object with that name prefix you are running the risk that it will not be accessible anymore after the next service pack install if Microsoft decided to create an object with the same name in the resource database. This is even true when the resource database object is of a different type than your object. This you can quickly confirm by creating a table with the name <span class=\"tt\">sp_executesql<\/span> in any database and trying to insert a row into it.\n<\/p>\n<h3>Master Piece<\/h3>\n<p>\nThe fact that the resource database is the one checked first to resolve \"sp_\" object names raises the question where the <span class=\"tt\">master<\/span> database fits in. Read on, as the results might surprise you.\n<\/p>\n<p>\nThe second test involves a procedure that is not (yet) part of the resource database: <span class=\"tt\">sp_MyOwnProc<\/span>\n<\/p>\n<p>\nI again created this procedure in <span class=\"tt\">master<\/span> and in <span class=\"tt\">test<\/span>:\n<\/p>\n<div>\n[sql]\nGO<br \/>\nUSE master;<br \/>\nGO<br \/>\nCREATE PROCEDURE sp_MyOwnProc<br \/>\nAS<br \/>\nBEGIN<br \/>\n  SELECT DB_NAME() [called from], 'master' [sp_MyOwnProc];<br \/>\nEND<br \/>\nGO<br \/>\nUSE test;<br \/>\nGO<br \/>\nCREATE PROCEDURE sp_MyOwnProc<br \/>\nAS<br \/>\nBEGIN<br \/>\n  SELECT DB_NAME() [called from], 'test' [sp_MyOwnProc];<br \/>\nEND<br \/>\nGO<br \/>\nEXEC sp_MyOwnProc;<br \/>\nGO<br \/>\nUSE OtherDb;<br \/>\nGO<br \/>\nEXEC sp_MyOwnProc;<br \/>\nGO<br \/>\nUSE test;<br \/>\nGO<br \/>\nDROP PROCEDURE sp_MyOwnProc;<br \/>\nGO<br \/>\nUSE master;<br \/>\nGO<br \/>\nDROP PROCEDURE sp_MyOwnProc;<br \/>\nGO<br \/>\n[\/sql]\n<\/div>\n<p>\nThe above code creates the procedure in both places. It then executes the <span class=\"tt\">EXEC sp_MyOwnProc;<\/span> statement, first from the <span class=\"tt\">test<\/span> database and afterwards from the <span class=\"tt\">OtherDb<\/span> database. The result is shown below:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_MyOwnProc_test_results.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_MyOwnProc_test_results.png\" alt=\"sp_MyOwnProc test results\" title=\"sp_MyOwnProc test results\" width=\"200\" height=\"108\" class=\"aligncenter size-full wp-image-966\" \/><\/a>\n<\/p>\n<p>\nAs you can see, <span class=\"tt\">master<\/span> is not checked first for an \"sp_\" object. Instead the object in the current database is used. Only if the current database does not contain the object in question <span class=\"tt\">master<\/span> is looked at to see if the object exists in there.\n<\/p>\n<p>\nThe same behavior can be observed when all references to the <span class=\"tt\">sp_MyOwnProc<\/span> in the above script are schema-qualified with <span class=\"tt\">dbo.<\/span>\n<\/p>\n<h3>Other Object Types<\/h3>\n<p>\nYou also get the same behavior if you go through this exercise with a table:\n<\/p>\n<div>\n[sql]\nUSE master;<br \/>\nGO<br \/>\nCREATE TABLE sp_MyOwnTable(<br \/>\nsp_MyOwnTable NVARCHAR(MAX)<br \/>\n);<br \/>\nINSERT INTO sp_MyOwnTable SELECT DB_NAME();<br \/>\nGO<br \/>\nUSE test;<br \/>\nGO<br \/>\nCREATE TABLE sp_MyOwnTable(<br \/>\nsp_MyOwnTable NVARCHAR(MAX)<br \/>\n);<br \/>\nINSERT INTO sp_MyOwnTable SELECT DB_NAME();<br \/>\nGO<br \/>\nSELECT DB_NAME() [called from], * FROM sp_MyOwnTable;<br \/>\nGO<br \/>\nUSE OtherDb;<br \/>\nGO<br \/>\nSELECT DB_NAME() [called from], * FROM sp_MyOwnTable;<br \/>\nGO<br \/>\nUSE test;<br \/>\nGO<br \/>\nDROP TABLE sp_MyOwnTable;<br \/>\nGO<br \/>\nUSE master;<br \/>\nGO<br \/>\nDROP TABLE sp_MyOwnTable;<br \/>\nGO<br \/>\n[\/sql]\n<\/div>\n<p>\nThis script creates a table with the name <span class=\"tt\">sp_MyOwnTable<\/span> in the <span class=\"tt\">master<\/span> as well as in the <span class=\"tt\">test<\/span> database and then executes a select against this name executing in <span class=\"tt\">test<\/span> as well as in <span class=\"tt\">OtherDb<\/span>. The result is shown here:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_MyOwnTable_test_reults.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_MyOwnTable_test_reults.png\" alt=\"sp_MyOwnTable test reults\" title=\"sp_MyOwnTable test reults\" width=\"206\" height=\"108\" class=\"aligncenter size-full wp-image-967\" \/><\/a>\n<\/p>\n<p>\nThis shows that the name resolution works the same for tables as it does for stored procedures. It also works views, but not for functions or user defined types.\n<\/p>\n<h3>Performance Impact<\/h3>\n<p>\nNow we know that SQL Server tries to find an \"sp_\" object in the resource database first and only if it does not exist there the search is continued in the current database. So there should be a measurable performance impact showing this extra work.\n<\/p>\n<p>\nTo measure the impact I used this script:\n<\/p>\n<div>\n[sql]\nUSE test;<br \/>\nGO<br \/>\nIF OBJECT_ID('dbo.sp_MyOwnProc2') IS NOT NULL DROP PROCEDURE dbo.sp_MyOwnProc2;<br \/>\nGO<br \/>\nCREATE PROCEDURE dbo.sp_MyOwnProc2<br \/>\nAS<br \/>\nRETURN 0;<br \/>\nGO<br \/>\nIF OBJECT_ID('dbo.MyOwnProc2') IS NOT NULL DROP PROCEDURE dbo.MyOwnProc2;<br \/>\nGO<br \/>\nCREATE PROCEDURE dbo.MyOwnProc2<br \/>\nAS<br \/>\nRETURN 0;<br \/>\nGO<br \/>\n------------------------------------<br \/>\nGO<br \/>\nDECLARE @StartTime DATETIME2 = SYSDATETIME();<br \/>\nDECLARE @EndTime DATETIME2 = SYSDATETIME();<br \/>\nDECLARE @Counter INT = 0;<br \/>\nDECLARE @CmdA NVARCHAR(100) = 'EXEC dbo.MyOwnProc2;--';<br \/>\nDECLARE @CmdB NVARCHAR(100) = 'EXEC dbo.sp_MyOwnProc2;--';<br \/>\nDECLARE @TimeA BIGINT=0;<br \/>\nDECLARE @TimeB BIGINT=0;<br \/>\nDECLARE @Cmd2 NVARCHAR(100);<br \/>\nWHILE(@Counter&lt;10000000)<br \/>\nBEGIN<br \/>\n  SET @Cmd2 = @CmdA + CAST(@Counter AS NVARCHAR(20));<br \/>\n  SET @StartTime = SYSDATETIME();<br \/>\n  EXEC(@Cmd2);<br \/>\n  SET @EndTime = SYSDATETIME();<br \/>\n  SET @TimeA += DATEDIFF(microsecond,@StartTime,@EndTime)<br \/>\n  SET @Cmd2 = @CmdB + CAST(@Counter AS NVARCHAR(20));<br \/>\n  SET @StartTime = SYSDATETIME();<br \/>\n  EXEC(@Cmd2);<br \/>\n  SET @EndTime = SYSDATETIME();<br \/>\n  SET @TimeB += DATEDIFF(microsecond,@StartTime,@EndTime)<br \/>\n  SET @Counter += 1;<br \/>\nEND<br \/>\nSELECT @Counter Counter,@TimeA [MyOwnProc2], @TimeB [sp_MyOwnProc2];<br \/>\nGO<br \/>\n[\/sql]\n<\/div>\n<p>\nIt first creates two identical stored procedures that do nothing but return a 0. The first one is called <span class=\"tt\">sp_MyOwnProc2<\/span>, the second one carries the name <span class=\"tt\">MyOwnProc2<\/span> without the \"sp_\" prefix. To measure the performance impact, the script calls both procedures alternating in a loop and records their execution times. Each call gets executed as dynamic sql with the current loop count being part of the sql string. This prevents any possible attempts to cache the plan for the batch. It does however not prevent caching the plan for the procedure itself. That is okay, as we are after the name resolution piece of the execution. Because both procedures get called alternatingly, any background noise caused by other processes on the test system should affect both evenly.\n<\/p>\n<p>\nOn my system I got these results:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_prefix_performance_test_results.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_prefix_performance_test_results.png\" alt=\"sp_ prefix performance test results\" title=\"sp_ prefix performance test results\" width=\"283\" height=\"63\" class=\"aligncenter size-full wp-image-968\" \/><\/a>\n<\/p>\n<p>\nAfter 10 million executions of each of the two procedures you can see, that there is a performance impact. With less than 2 percent, however, it is very small compared to the time it takes to just call the procedure. Remember, that the procedures in this test did not actually do any work, so all the time recorded by this test was spent on identifying the procedure and the overhead of calling it.\n<\/p>\n<h3>Conclusion<\/h3>\n<p>\nThe \"sp_\" object name prefix causes SQL Server to take a special route when resolving the name of this object: First SQL Server checks if the object exists in the hidden resource database. Second it tries to find the object in the current database and if it does not exist there SQL Server goes on to check if the object exists in the <span class=\"tt\">master<\/span> database.\n<\/p>\n<p>\nIf you name your own objects using this prefix, you have to be aware of two possible consequences:<br \/>\nFirst there is a small but measurable impact on performance. Second it can cause your application to suddenly break, if Microsoft decides to add an object with the same name to the resource database.\n<\/p>\n<p>\nBecause of that it is a best practice to not use the \"sp_\" name prefix anywhere in your code.\n<\/p>\n<p>\nThere is one exception however: If you are creating an object that you want to be accessible from all databases, you can use this prefix and place the object in the <span class=\"tt\">master<\/span> database. However, because of the database precedence there are now two possibilities for those objects to get eclipsed by another object. So, if you go this route, make sure to regularly check that the object you are trying to execute is actually the one executing.\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\nIf you have been working with SQL Server for a while you probably know that you should not select names for your stored procedures that start with the three characters &#8220;sp_&#8221;.\n<\/p>\n<p>\nToday I would like to take a closer look at all the myths and facts around this prefix. All examples in this article have been tested on SQL 2008R2 and on SQL 2012.\n<\/p>\n<p> <a href=\"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/\">[more&#8230;]<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[5,19,14],"tags":[],"class_list":["post-961","post","type-post","status-publish","format-standard","hentry","category-general","category-performance","category-sql-server-internals"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The Mysterious &quot;sp_&quot; System Procedure Prefix - sqlity.net<\/title>\n<meta name=\"description\" content=\"This article takes a look at all the Myths and Facts around the &quot;sp_&quot; prefix that is used in SQL Server for system procedures.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The Mysterious &quot;sp_&quot; System Procedure Prefix - sqlity.net\" \/>\n<meta property=\"og:description\" content=\"This article takes a look at all the Myths and Facts around the &quot;sp_&quot; prefix that is used in SQL Server for system procedures.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/\" \/>\n<meta property=\"og:site_name\" content=\"sqlity.net\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sqlity.net\" \/>\n<meta property=\"article:published_time\" content=\"2012-05-13T21:04:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-13T18:57:50+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_executesql_test_results.png\" \/>\n<meta name=\"author\" content=\"Sebastian Meine\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@sqlity\" \/>\n<meta name=\"twitter:site\" content=\"@sqlity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sebastian Meine\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/961\\\/the-mysterious-sp_-system-procedure-prefix\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/961\\\/the-mysterious-sp_-system-procedure-prefix\\\/\"},\"author\":{\"name\":\"Sebastian Meine\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"headline\":\"The Mysterious &#8220;sp_&#8221; System Procedure Prefix\",\"datePublished\":\"2012-05-13T21:04:46+00:00\",\"dateModified\":\"2014-11-13T18:57:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/961\\\/the-mysterious-sp_-system-procedure-prefix\\\/\"},\"wordCount\":1641,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/961\\\/the-mysterious-sp_-system-procedure-prefix\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/05\\\/sp_executesql_test_results.png\",\"articleSection\":[\"General\",\"Performance\",\"SQL Server Internals\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/961\\\/the-mysterious-sp_-system-procedure-prefix\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/961\\\/the-mysterious-sp_-system-procedure-prefix\\\/\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/961\\\/the-mysterious-sp_-system-procedure-prefix\\\/\",\"name\":\"The Mysterious \\\"sp_\\\" System Procedure Prefix - sqlity.net\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/961\\\/the-mysterious-sp_-system-procedure-prefix\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/961\\\/the-mysterious-sp_-system-procedure-prefix\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/05\\\/sp_executesql_test_results.png\",\"datePublished\":\"2012-05-13T21:04:46+00:00\",\"dateModified\":\"2014-11-13T18:57:50+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"description\":\"This article takes a look at all the Myths and Facts around the \\\"sp_\\\" prefix that is used in SQL Server for system procedures.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/961\\\/the-mysterious-sp_-system-procedure-prefix\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/961\\\/the-mysterious-sp_-system-procedure-prefix\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/961\\\/the-mysterious-sp_-system-procedure-prefix\\\/#primaryimage\",\"url\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/05\\\/sp_executesql_test_results.png\",\"contentUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/05\\\/sp_executesql_test_results.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/961\\\/the-mysterious-sp_-system-procedure-prefix\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The Mysterious &#8220;sp_&#8221; System Procedure Prefix\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\",\"name\":\"sqlity.net\",\"description\":\"Quality for SQL\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sqlity.net\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\",\"name\":\"Sebastian Meine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"caption\":\"Sebastian Meine\"},\"sameAs\":[\"http:\\\/\\\/sqlity.net\",\"https:\\\/\\\/x.com\\\/sqlity\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The Mysterious \"sp_\" System Procedure Prefix - sqlity.net","description":"This article takes a look at all the Myths and Facts around the \"sp_\" prefix that is used in SQL Server for system procedures.","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:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/","og_locale":"en_US","og_type":"article","og_title":"The Mysterious \"sp_\" System Procedure Prefix - sqlity.net","og_description":"This article takes a look at all the Myths and Facts around the \"sp_\" prefix that is used in SQL Server for system procedures.","og_url":"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/","og_site_name":"sqlity.net","article_publisher":"https:\/\/www.facebook.com\/sqlity.net","article_published_time":"2012-05-13T21:04:46+00:00","article_modified_time":"2014-11-13T18:57:50+00:00","og_image":[{"url":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_executesql_test_results.png","type":"","width":"","height":""}],"author":"Sebastian Meine","twitter_card":"summary_large_image","twitter_creator":"@sqlity","twitter_site":"@sqlity","twitter_misc":{"Written by":"Sebastian Meine","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/#article","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/"},"author":{"name":"Sebastian Meine","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"headline":"The Mysterious &#8220;sp_&#8221; System Procedure Prefix","datePublished":"2012-05-13T21:04:46+00:00","dateModified":"2014-11-13T18:57:50+00:00","mainEntityOfPage":{"@id":"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/"},"wordCount":1641,"commentCount":0,"image":{"@id":"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_executesql_test_results.png","articleSection":["General","Performance","SQL Server Internals"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/","url":"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/","name":"The Mysterious \"sp_\" System Procedure Prefix - sqlity.net","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/#primaryimage"},"image":{"@id":"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_executesql_test_results.png","datePublished":"2012-05-13T21:04:46+00:00","dateModified":"2014-11-13T18:57:50+00:00","author":{"@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"description":"This article takes a look at all the Myths and Facts around the \"sp_\" prefix that is used in SQL Server for system procedures.","breadcrumb":{"@id":"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/#primaryimage","url":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_executesql_test_results.png","contentUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/05\/sp_executesql_test_results.png"},{"@type":"BreadcrumbList","@id":"https:\/\/sqlity.net\/en\/961\/the-mysterious-sp_-system-procedure-prefix\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sqlity.net\/en\/"},{"@type":"ListItem","position":2,"name":"The Mysterious &#8220;sp_&#8221; System Procedure Prefix"}]},{"@type":"WebSite","@id":"https:\/\/sqlity.net\/en\/#website","url":"https:\/\/sqlity.net\/en\/","name":"sqlity.net","description":"Quality for SQL","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sqlity.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c","name":"Sebastian Meine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","caption":"Sebastian Meine"},"sameAs":["http:\/\/sqlity.net","https:\/\/x.com\/sqlity"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2wXuw-fv","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/961","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/comments?post=961"}],"version-history":[{"count":0,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/961\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/media?parent=961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/categories?post=961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/tags?post=961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}