<?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>INSERT INTO SELECT &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/insert-into-select/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, 23 May 2018 19:08:07 +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: Basic performance test between SELECT INTO and INSERT INTO SELECT</title>
		<link>https://www.dbrnd.com/2018/07/sql-server-basic-performance-test-between-select-into-and-insert-into-select/</link>
					<comments>https://www.dbrnd.com/2018/07/sql-server-basic-performance-test-between-select-into-and-insert-into-select/#respond</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 23 Jul 2018 16:16:07 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[INSERT INTO SELECT]]></category>
		<category><![CDATA[SELECT INTO]]></category>
		<category><![CDATA[SQL Programming]]></category>
		<category><![CDATA[sql queries]]></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[sqlcode]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7656</guid>

					<description><![CDATA[<div><img width="679" height="679" src="https://www.dbrnd.com/wp-content/uploads/2018/05/Good-vs-Bad-679x679.jpg" class="attachment-post-image size-post-image wp-post-image" alt="" decoding="async" fetchpriority="high" srcset="https://www.dbrnd.com/wp-content/uploads/2018/05/Good-vs-Bad-679x679.jpg 679w, https://www.dbrnd.com/wp-content/uploads/2018/05/Good-vs-Bad-150x150.jpg 150w, https://www.dbrnd.com/wp-content/uploads/2018/05/Good-vs-Bad-300x300.jpg 300w, https://www.dbrnd.com/wp-content/uploads/2018/05/Good-vs-Bad-600x600.jpg 600w, https://www.dbrnd.com/wp-content/uploads/2018/05/Good-vs-Bad.jpg 800w" sizes="(max-width: 679px) 100vw, 679px" /></div>In this post, I am doing a basic performance test between SELECT INTO and INSERT INTO SELECT option of SQL Server. Database Developers are using these options very frequently for copying data between the tables. But SELECT INTO is little faster than INSERT INTO SELECT option. Note: I am testing using a very small number [&#8230;]]]></description>
										<content:encoded><![CDATA[<div><img width="679" height="679" src="https://www.dbrnd.com/wp-content/uploads/2018/05/Good-vs-Bad-679x679.jpg" class="attachment-post-image size-post-image wp-post-image" alt="" decoding="async" srcset="https://www.dbrnd.com/wp-content/uploads/2018/05/Good-vs-Bad-679x679.jpg 679w, https://www.dbrnd.com/wp-content/uploads/2018/05/Good-vs-Bad-150x150.jpg 150w, https://www.dbrnd.com/wp-content/uploads/2018/05/Good-vs-Bad-300x300.jpg 300w, https://www.dbrnd.com/wp-content/uploads/2018/05/Good-vs-Bad-600x600.jpg 600w, https://www.dbrnd.com/wp-content/uploads/2018/05/Good-vs-Bad.jpg 800w" sizes="(max-width: 679px) 100vw, 679px" /></div><p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F07%2Fsql-server-basic-performance-test-between-select-into-and-insert-into-select%2F&amp;linkname=SQL%20Server%3A%20Basic%20performance%20test%20between%20SELECT%20INTO%20and%20INSERT%20INTO%20SELECT" 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%2F2018%2F07%2Fsql-server-basic-performance-test-between-select-into-and-insert-into-select%2F&amp;linkname=SQL%20Server%3A%20Basic%20performance%20test%20between%20SELECT%20INTO%20and%20INSERT%20INTO%20SELECT" 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%2F2018%2F07%2Fsql-server-basic-performance-test-between-select-into-and-insert-into-select%2F&amp;linkname=SQL%20Server%3A%20Basic%20performance%20test%20between%20SELECT%20INTO%20and%20INSERT%20INTO%20SELECT" 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%2F2018%2F07%2Fsql-server-basic-performance-test-between-select-into-and-insert-into-select%2F&amp;linkname=SQL%20Server%3A%20Basic%20performance%20test%20between%20SELECT%20INTO%20and%20INSERT%20INTO%20SELECT" 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%2F2018%2F07%2Fsql-server-basic-performance-test-between-select-into-and-insert-into-select%2F&amp;linkname=SQL%20Server%3A%20Basic%20performance%20test%20between%20SELECT%20INTO%20and%20INSERT%20INTO%20SELECT" 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%2F2018%2F07%2Fsql-server-basic-performance-test-between-select-into-and-insert-into-select%2F&amp;linkname=SQL%20Server%3A%20Basic%20performance%20test%20between%20SELECT%20INTO%20and%20INSERT%20INTO%20SELECT" 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%2F2018%2F07%2Fsql-server-basic-performance-test-between-select-into-and-insert-into-select%2F&#038;title=SQL%20Server%3A%20Basic%20performance%20test%20between%20SELECT%20INTO%20and%20INSERT%20INTO%20SELECT" data-a2a-url="https://www.dbrnd.com/2018/07/sql-server-basic-performance-test-between-select-into-and-insert-into-select/" data-a2a-title="SQL Server: Basic performance test between SELECT INTO and INSERT INTO SELECT"></a></p><p>In this post, I am doing a basic performance test between SELECT INTO and INSERT INTO SELECT option of SQL Server. </p>
<p>Database Developers are using these options very frequently for copying data between the tables. But SELECT INTO is little faster than INSERT INTO SELECT option. </p>
<p><em>Note: I am testing using a very small number of sample records. If you are testing with a huge number of records, you may find a big difference in the performance. </em></p>
<p><strong>Please check the below examples: </strong></p>
<p><strong>Set Statistics:</strong></p>
<pre class="crayon-plain-tag">SET STATISTICS IO ON
SET STATISTICS TIME ON</pre> </p>
<p><strong>Create sample tables:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_MyData (ID INT, Name VARCHAR(10))
CREATE TABLE tbl_Mytable (ID INT, Name VARCHAR(10))

INSERT INTO tbl_MyData VALUES (1,'dbrnd')
GO 1000000</pre> </p>
<p><strong>Perform INSERT INTO SELECT:</strong></p>
<pre class="crayon-plain-tag">INSERT INTO  tbl_Mytable 
SELECT ID, Name 
FROM tbl_MyData</pre> </p>
<p><strong>Execution time:</strong></p>
<pre class="crayon-plain-tag">SQL Server Execution Times:
CPU time = 16 ms,  elapsed time = 37 ms.</pre> </p>
<p><strong>Perform SELECT INTO:</strong></p>
<pre class="crayon-plain-tag">SELECT ID, Name 
INTO tbl_MyTable2
FROM tbl_MyData</pre> </p>
<p><strong>Execution time:</strong></p>
<pre class="crayon-plain-tag">SQL Server Execution Times:
CPU time = 16 ms,  elapsed time = 21 ms.</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2018/07/sql-server-basic-performance-test-between-select-into-and-insert-into-select/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
