<?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>swap table &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/swap-table/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>Fri, 06 Jul 2018 20:27:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>MySQL: How to Swap Table or Rename the table in one transaction?</title>
		<link>https://www.dbrnd.com/2018/08/mysql-how-to-swap-table-or-rename-the-table-in-one-transaction/</link>
					<comments>https://www.dbrnd.com/2018/08/mysql-how-to-swap-table-or-rename-the-table-in-one-transaction/#respond</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 06 Aug 2018 16:16:24 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tuning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[Rename Table]]></category>
		<category><![CDATA[swap table]]></category>
		<category><![CDATA[swap table in a transaction]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7696</guid>

					<description><![CDATA[In this post, I am sharing a command to swap the table in a MySQL Database. Recently, I got a requirement like a swap or rename the table, it should execute in a lock/transaction. People can access the table before or after the swapping only. In an ETL/Database work, we are creating a staging table [&#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%2F2018%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&amp;linkname=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%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%2F2018%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&amp;linkname=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%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%2F2018%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&amp;linkname=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%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%2F2018%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&amp;linkname=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%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%2F2018%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&amp;linkname=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%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%2F2018%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&amp;linkname=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%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%2F2018%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&#038;title=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%3F" data-a2a-url="https://www.dbrnd.com/2018/08/mysql-how-to-swap-table-or-rename-the-table-in-one-transaction/" data-a2a-title="MySQL: How to Swap Table or Rename the table in one transaction?"></a></p><p>In this post, I am sharing a command to swap the table in a MySQL Database. </p>
<p>Recently, I got a requirement like a swap or rename the table, it should execute in a lock/transaction. People can access the table before or after the swapping only. </p>
<p>In an ETL/Database work, we are creating a staging table for validation and later it requires to overwrite with an original table name. </p>
<p><strong>Below is a simple command, which you can use for this task:</strong><br />
Here, DBRND_Original is an existing table and DBRND_Original_New is my staging table.<br />
Now, I am swapping the table using one rename command which performs whole swapping operation in one transaction.</p>
<pre class="crayon-plain-tag">RENAME TABLE DBRND_Original TO DBRND_Original_Backup, DBRND_Original_New To DBRND_Original;</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2018/08/mysql-how-to-swap-table-or-rename-the-table-in-one-transaction/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
