<?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>REPEATABLE READ &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/repeatable-read/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>Thu, 09 Nov 2017 12:42:06 +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>SQL Server: What is REPEATABLE READ Isolation Level?</title>
		<link>https://www.dbrnd.com/2016/04/sql-server-what-is-repeatable-read-isolation-level/</link>
					<comments>https://www.dbrnd.com/2016/04/sql-server-what-is-repeatable-read-isolation-level/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 03 Apr 2016 06:24:53 +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[Isolation level]]></category>
		<category><![CDATA[REPEATABLE READ]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2223</guid>

					<description><![CDATA[The REPEATABLE READ allows you to read the same data repeatedly and it makes sure that any transaction cannot update this data until you complete your reading. If you are selecting the same row twice in a transaction, you will get the same results both the times. If someone is modifying the data, you cannot [&#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%2F2016%2F04%2Fsql-server-what-is-repeatable-read-isolation-level%2F&amp;linkname=SQL%20Server%3A%20What%20is%20REPEATABLE%20READ%20Isolation%20Level%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%2F2016%2F04%2Fsql-server-what-is-repeatable-read-isolation-level%2F&amp;linkname=SQL%20Server%3A%20What%20is%20REPEATABLE%20READ%20Isolation%20Level%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%2F2016%2F04%2Fsql-server-what-is-repeatable-read-isolation-level%2F&amp;linkname=SQL%20Server%3A%20What%20is%20REPEATABLE%20READ%20Isolation%20Level%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%2F2016%2F04%2Fsql-server-what-is-repeatable-read-isolation-level%2F&amp;linkname=SQL%20Server%3A%20What%20is%20REPEATABLE%20READ%20Isolation%20Level%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%2F2016%2F04%2Fsql-server-what-is-repeatable-read-isolation-level%2F&amp;linkname=SQL%20Server%3A%20What%20is%20REPEATABLE%20READ%20Isolation%20Level%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%2F2016%2F04%2Fsql-server-what-is-repeatable-read-isolation-level%2F&amp;linkname=SQL%20Server%3A%20What%20is%20REPEATABLE%20READ%20Isolation%20Level%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%2F2016%2F04%2Fsql-server-what-is-repeatable-read-isolation-level%2F&#038;title=SQL%20Server%3A%20What%20is%20REPEATABLE%20READ%20Isolation%20Level%3F" data-a2a-url="https://www.dbrnd.com/2016/04/sql-server-what-is-repeatable-read-isolation-level/" data-a2a-title="SQL Server: What is REPEATABLE READ Isolation Level?"></a></p><p>The REPEATABLE READ allows you to read the same data repeatedly and it makes sure that any transaction cannot update this data until you complete your reading.<br />
If you are selecting the same row twice in a transaction, you will get the same results both the times. </p>
<blockquote><p>If someone is modifying the data, you cannot even read those data until they complete the update.<br />
This is very similar to READ COMMITTED Isolation level. </p></blockquote>
<blockquote><p>The REPEATABLE READ issues the shared locks on all statements which are in the transaction.<br />
The shared locks do not release lock at each statement level, but it applies at the transaction level.
</p></blockquote>
<blockquote><p>The REPEATABLE READ does not stop insertion of newer records so when we are reading data with this isolation level, there is a chance to get Phantom or Dirty Reads.</p></blockquote>
<blockquote><p>For example,<br />
You are selecting range data between ID 200 and ID 500, and in this range, we have one free ID which is 394. </p>
<p>Now the user is going to insert a new record with ID 394, and you are selecting data from multiple sources, so there are chances to get different results for your both SELECT statements. </p>
<p>Like one data set with ID 394 and other data set may be without ID 394.</p></blockquote>
<p><strong>Now, test the REPEATABLE READ isolation level:</strong></p>
<p><strong>First, create a table with sample data:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_Employee
(
	EmpID INTEGER
	,EmpName VARCHAR(50)
)
GO
 
INSERT INTO tbl_Employee
VALUES 
(1,'Anvesh'),(2,'Neevan')
,(3,'Roy'),(4,'Martin')
GO</pre> </p>
<p><strong>Open a new query window or session and executing this script:</strong></p>
<pre class="crayon-plain-tag">SET TRANSACTION ISOLATION LEVEL REPEATABLE READ  

BEGIN TRAN  

SELECT *FROM tbl_Employee
WAITFOR DELAY '00:00:15'
SELECT *FROM tbl_Employee

ROLLBACK</pre> </p>
<p><strong>During the delay of 15 seconds, Open a new query window or session and try to UPDATE this table:</strong></p>
<pre class="crayon-plain-tag">UPDATE tbl_Employee SET EmpName ='Loother' WHERE EmpID=4</pre> </p>
<p>Now, you can not UPDATE the data because it used by another session. </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/04/sql-server-what-is-repeatable-read-isolation-level/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
