<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Global Temp &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/global-temp/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Wed, 09 Aug 2017 06:44:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>SQL Server Interview: Have you ever created a Temporary Stored Procedure or Function?</title>
		<link>https://www.dbrnd.com/2017/08/sql-server-interview-have-you-ever-created-a-temporary-stored-procedure-or-function/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 15 Aug 2017 16:16:01 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Global Temp]]></category>
		<category><![CDATA[Local Temp]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[Temp Stored Procedure]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5872</guid>

					<description><![CDATA[In this post, I am sharing an interesting interview question and answer for SQL Database Developer. Most of the guys knew about the SQL Server Local Temp Table and Global Temp Table. But same as like Temp table, you can also create Temp Stored procedure or Temp function in locally or globally. Please don&#8217;t confuse [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-interview-have-you-ever-created-a-temporary-stored-procedure-or-function%2F&amp;linkname=SQL%20Server%20Interview%3A%20Have%20you%20ever%20created%20a%20Temporary%20Stored%20Procedure%20or%20Function%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-interview-have-you-ever-created-a-temporary-stored-procedure-or-function%2F&amp;linkname=SQL%20Server%20Interview%3A%20Have%20you%20ever%20created%20a%20Temporary%20Stored%20Procedure%20or%20Function%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-interview-have-you-ever-created-a-temporary-stored-procedure-or-function%2F&amp;linkname=SQL%20Server%20Interview%3A%20Have%20you%20ever%20created%20a%20Temporary%20Stored%20Procedure%20or%20Function%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-interview-have-you-ever-created-a-temporary-stored-procedure-or-function%2F&amp;linkname=SQL%20Server%20Interview%3A%20Have%20you%20ever%20created%20a%20Temporary%20Stored%20Procedure%20or%20Function%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-interview-have-you-ever-created-a-temporary-stored-procedure-or-function%2F&amp;linkname=SQL%20Server%20Interview%3A%20Have%20you%20ever%20created%20a%20Temporary%20Stored%20Procedure%20or%20Function%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-interview-have-you-ever-created-a-temporary-stored-procedure-or-function%2F&amp;linkname=SQL%20Server%20Interview%3A%20Have%20you%20ever%20created%20a%20Temporary%20Stored%20Procedure%20or%20Function%3F" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-interview-have-you-ever-created-a-temporary-stored-procedure-or-function%2F&#038;title=SQL%20Server%20Interview%3A%20Have%20you%20ever%20created%20a%20Temporary%20Stored%20Procedure%20or%20Function%3F" data-a2a-url="https://www.dbrnd.com/2017/08/sql-server-interview-have-you-ever-created-a-temporary-stored-procedure-or-function/" data-a2a-title="SQL Server Interview: Have you ever created a Temporary Stored Procedure or Function?"></a></p><p>In this post, I am sharing an interesting interview question and answer for SQL Database Developer.</p>
<blockquote><p>Most of the guys knew about the SQL Server Local Temp Table and Global Temp Table.<br />
But same as like Temp table, you can also create Temp Stored procedure or Temp function in locally or globally.</p></blockquote>
<p>Please don&#8217;t confuse or surprise with this kind of question because in few scenarios you should create a Temp stored procedure or function.</p>
<p><strong>Few facts:</strong></p>
<ul>
<li>Use single # for a local temporary SP. Once you close your session, it will drop automatically</li>
<li>Use double ## for a global temporary SP</li>
<li>Temporary SP behaves like normal SP</li>
<li>You should create temporary SP for testing purpose</li>
<li>During deployment, if you have a script that uses repetitive code, you can create a temporary SP</li>
<li>You can create a global temporary SP so that you can connect/execute your test code from all the databases</li>
<li>You can create temporary SP for temporary maintenance work</li>
</ul>
<p><strong>Create a sample global temporary SP:</strong><br />
<pre class="crayon-plain-tag">CREATE PROC ##TempProc
AS
DECLARE @TempTable TABLE (col1 INT)

INSERT INTO @TempTable(col1)
VALUES (1),(2),(3)

SELECT * FROM @TempTable
RETURN 0</pre>
<p><strong>Execute:</strong><br />
<pre class="crayon-plain-tag">EXEC ##TempProc</pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
