<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; 2008 &#8211; SCOPE_IDENTITY Bug with Multi Processor Parallel Plan and Solution</title>
	<atom:link href="http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/</link>
	<description>SQL, SQL Server, MySQL, Big Data and NoSQL</description>
	<lastBuildDate>Wed, 19 Jun 2013 21:45:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Rafal</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-310125</link>
		<dc:creator><![CDATA[Rafal]]></dc:creator>
		<pubDate>Fri, 06 Jul 2012 10:15:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-310125</guid>
		<description><![CDATA[Small update, it is not wrong ID being returned, it is function run from transaction in procedure returning wrong ID. I now moved that simple select out of function back to procedure (directly), and I hope this won&#039;t reoccur.]]></description>
		<content:encoded><![CDATA[<p>Small update, it is not wrong ID being returned, it is function run from transaction in procedure returning wrong ID. I now moved that simple select out of function back to procedure (directly), and I hope this won&#8217;t reoccur.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rafal</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-309638</link>
		<dc:creator><![CDATA[Rafal]]></dc:creator>
		<pubDate>Thu, 05 Jul 2012 13:08:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-309638</guid>
		<description><![CDATA[Hey Dave, I encountered the problem with scope_identity() before, and changed all single row INSERT INTO statements to use OUTPUT INTO clause. However I am still seeing incorrect ID being returned from time to time (rarely, yet still...) and I am confused now. Is it possible that incorrect ID is returned by OUTPUT INTO clause, when multiple calls to the procedure using it are made at the same type? Above INSERT INTO is run in TRANSACTION, and since large amount of interactions with DB lead to many DEADLOCKS, our DB is setup with SET READ_COMMITTED_SNAPSHOT ON; and SET ALLOW_SNAPSHOT_ISOLATION ON;. However the records getting incorrect ID are several hours apart from each other, which would suggest it&#039;s not a matter of using SNAPSHOT. Any ideas?]]></description>
		<content:encoded><![CDATA[<p>Hey Dave, I encountered the problem with scope_identity() before, and changed all single row INSERT INTO statements to use OUTPUT INTO clause. However I am still seeing incorrect ID being returned from time to time (rarely, yet still&#8230;) and I am confused now. Is it possible that incorrect ID is returned by OUTPUT INTO clause, when multiple calls to the procedure using it are made at the same type? Above INSERT INTO is run in TRANSACTION, and since large amount of interactions with DB lead to many DEADLOCKS, our DB is setup with SET READ_COMMITTED_SNAPSHOT ON; and SET ALLOW_SNAPSHOT_ISOLATION ON;. However the records getting incorrect ID are several hours apart from each other, which would suggest it&#8217;s not a matter of using SNAPSHOT. Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: siddu.</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-290233</link>
		<dc:creator><![CDATA[siddu.]]></dc:creator>
		<pubDate>Tue, 29 May 2012 05:28:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-290233</guid>
		<description><![CDATA[Hi guys,
here i am trying to assing the last inserted identity value to the variable named @ID and I am getting an error but this is the requirement for me. Is there any solution for this ?
here is the same kind of script....

begin tran
declare @ID int
set @ID = 0
insert into T1 values(&#039;me&#039;)
output @ID = Inserted.id
print @ID
rollback tran

thanks.]]></description>
		<content:encoded><![CDATA[<p>Hi guys,<br />
here i am trying to assing the last inserted identity value to the variable named @ID and I am getting an error but this is the requirement for me. Is there any solution for this ?<br />
here is the same kind of script&#8230;.</p>
<p>begin tran<br />
declare @ID int<br />
set @ID = 0<br />
insert into T1 values(&#8216;me&#8217;)<br />
output @ID = Inserted.id<br />
print @ID<br />
rollback tran</p>
<p>thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phoe Chang</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-133871</link>
		<dc:creator><![CDATA[Phoe Chang]]></dc:creator>
		<pubDate>Tue, 10 May 2011 18:34:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-133871</guid>
		<description><![CDATA[Hi Penal,

I suspect that we are running into this problem.  But the stored proc that uses SCOPE_IDENTIFY is a very simple insert statement.  We do get an invalid ID a couple of times a day. 
 
How do I confirm that this is caused by this known bug?  I am not sure when SQL server 2008 will choose  generate a parallel plan.

Hope to hear from you.  Thanks!]]></description>
		<content:encoded><![CDATA[<p>Hi Penal,</p>
<p>I suspect that we are running into this problem.  But the stored proc that uses SCOPE_IDENTIFY is a very simple insert statement.  We do get an invalid ID a couple of times a day. </p>
<p>How do I confirm that this is caused by this known bug?  I am not sure when SQL server 2008 will choose  generate a parallel plan.</p>
<p>Hope to hear from you.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sarika</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-103413</link>
		<dc:creator><![CDATA[Sarika]]></dc:creator>
		<pubDate>Thu, 02 Dec 2010 10:20:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-103413</guid>
		<description><![CDATA[hi pinal,

It&#039;s working fine.

Thanx]]></description>
		<content:encoded><![CDATA[<p>hi pinal,</p>
<p>It&#8217;s working fine.</p>
<p>Thanx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Archana</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-91273</link>
		<dc:creator><![CDATA[Archana]]></dc:creator>
		<pubDate>Tue, 05 Oct 2010 10:01:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-91273</guid>
		<description><![CDATA[How to use scope_identit. plz give any example.]]></description>
		<content:encoded><![CDATA[<p>How to use scope_identit. plz give any example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Archana</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-91272</link>
		<dc:creator><![CDATA[Archana]]></dc:creator>
		<pubDate>Tue, 05 Oct 2010 10:00:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-91272</guid>
		<description><![CDATA[How to use scope_identity plz show the exanple]]></description>
		<content:encoded><![CDATA[<p>How to use scope_identity plz show the exanple</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-69570</link>
		<dc:creator><![CDATA[Michael]]></dc:creator>
		<pubDate>Thu, 06 May 2010 21:45:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-69570</guid>
		<description><![CDATA[Is it possible to continue to use scope_identity() if you set the SQL Server to use only one (1) processor?  Would I get the right value every time?

I know this is not a long term solution.  But it would allow me to move from SQL 2000 to SQL 2008 right away.  Then go back and update the database along with web pages.]]></description>
		<content:encoded><![CDATA[<p>Is it possible to continue to use scope_identity() if you set the SQL Server to use only one (1) processor?  Would I get the right value every time?</p>
<p>I know this is not a long term solution.  But it would allow me to move from SQL 2000 to SQL 2008 right away.  Then go back and update the database along with web pages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-61529</link>
		<dc:creator><![CDATA[Pinal Dave]]></dc:creator>
		<pubDate>Sat, 20 Feb 2010 16:18:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-61529</guid>
		<description><![CDATA[IDENT_CURRENT() may return incorrect identity when multiple insertions performed by multiple connections at same time. Because its returns the last identity value for a table not the value that was generated by your session. 

Regards,
Pinal Dave]]></description>
		<content:encoded><![CDATA[<p>IDENT_CURRENT() may return incorrect identity when multiple insertions performed by multiple connections at same time. Because its returns the last identity value for a table not the value that was generated by your session. </p>
<p>Regards,<br />
Pinal Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mEmENT0m0RI</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-61504</link>
		<dc:creator><![CDATA[mEmENT0m0RI]]></dc:creator>
		<pubDate>Fri, 19 Feb 2010 22:23:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-61504</guid>
		<description><![CDATA[Saw this on 2005 while trying to INSERT SELECT using the cross-database query. IDENT_CURRENT() showed correct seed. Can this be used as a permanent work-around?]]></description>
		<content:encoded><![CDATA[<p>Saw this on 2005 while trying to INSERT SELECT using the cross-database query. IDENT_CURRENT() showed correct seed. Can this be used as a permanent work-around?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sam</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-59559</link>
		<dc:creator><![CDATA[sam]]></dc:creator>
		<pubDate>Mon, 11 Jan 2010 06:47:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-59559</guid>
		<description><![CDATA[hi Dave ,
Can u please provide us 1 example for this so that it can be very clear.......
Thkz &amp; Regards,
Sam]]></description>
		<content:encoded><![CDATA[<p>hi Dave ,<br />
Can u please provide us 1 example for this so that it can be very clear&#8230;&#8230;.<br />
Thkz &amp; Regards,<br />
Sam</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-59526</link>
		<dc:creator><![CDATA[Pinal Dave]]></dc:creator>
		<pubDate>Sat, 09 Jan 2010 17:28:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-59526</guid>
		<description><![CDATA[Hi Kuldeep,

How the trigger could affect the behaviour of OUTPUT clause?
The data in INSERTED table is affected nither by trigger nor 
by OUTPUT clause. Both are just reading this table.

Regards,
Pinal Dave]]></description>
		<content:encoded><![CDATA[<p>Hi Kuldeep,</p>
<p>How the trigger could affect the behaviour of OUTPUT clause?<br />
The data in INSERTED table is affected nither by trigger nor<br />
by OUTPUT clause. Both are just reading this table.</p>
<p>Regards,<br />
Pinal Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kuldeep</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-59516</link>
		<dc:creator><![CDATA[Kuldeep]]></dc:creator>
		<pubDate>Sat, 09 Jan 2010 12:26:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-59516</guid>
		<description><![CDATA[Hi Pinal,

Thanks for this wonderful peice of information.

But one thing I would like to get clarification from you here ,

as Output clause use inserted table 
and also triggers written for insert and update also using inserted table.

I guess  trigger on the same table will result in abnormal behaviour of output clause.

Pls. clarify this.

Kind Regards
Kuldeep]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>Thanks for this wonderful peice of information.</p>
<p>But one thing I would like to get clarification from you here ,</p>
<p>as Output clause use inserted table<br />
and also triggers written for insert and update also using inserted table.</p>
<p>I guess  trigger on the same table will result in abnormal behaviour of output clause.</p>
<p>Pls. clarify this.</p>
<p>Kind Regards<br />
Kuldeep</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kro</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-59394</link>
		<dc:creator><![CDATA[Kro]]></dc:creator>
		<pubDate>Wed, 06 Jan 2010 08:14:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-59394</guid>
		<description><![CDATA[What about deployed solutions, we can&#039;t just call each customer and say &#039;hay a bug was found in sql server which we don&#039;t know when it will be fixed (surely not soon) and we will change few lines of the code&#039; and I think every one knows What a big mess the customer will do when I answer to his question which is (what is that bug? and how it may effect in my business?)

and no one has a time to change the code and deploy it again to the customers we have other things to do.

work around for the new projects but what about the one in production. Need a solution not a work around.

The bad thing is not the bug (every one make mistake). but action that was taken to fix it is not acceptable. it is almost 2 years since the bug was issued and no serious action was taken to solve it. 

This is not the expected support that is supposed to be good.

I started to reconsider in other DBMS.]]></description>
		<content:encoded><![CDATA[<p>What about deployed solutions, we can&#8217;t just call each customer and say &#8216;hay a bug was found in sql server which we don&#8217;t know when it will be fixed (surely not soon) and we will change few lines of the code&#8217; and I think every one knows What a big mess the customer will do when I answer to his question which is (what is that bug? and how it may effect in my business?)</p>
<p>and no one has a time to change the code and deploy it again to the customers we have other things to do.</p>
<p>work around for the new projects but what about the one in production. Need a solution not a work around.</p>
<p>The bad thing is not the bug (every one make mistake). but action that was taken to fix it is not acceptable. it is almost 2 years since the bug was issued and no serious action was taken to solve it. </p>
<p>This is not the expected support that is supposed to be good.</p>
<p>I started to reconsider in other DBMS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Pellicaan</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-57496</link>
		<dc:creator><![CDATA[Rob Pellicaan]]></dc:creator>
		<pubDate>Tue, 10 Nov 2009 15:10:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-57496</guid>
		<description><![CDATA[Could you please post some more details on when this bug might occur? A sample script?

The scripts posted on the connect site to reproduce the problem are not downloadable.

Thanks.]]></description>
		<content:encoded><![CDATA[<p>Could you please post some more details on when this bug might occur? A sample script?</p>
<p>The scripts posted on the connect site to reproduce the problem are not downloadable.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil Stenger</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-52073</link>
		<dc:creator><![CDATA[Phil Stenger]]></dc:creator>
		<pubDate>Tue, 19 May 2009 19:33:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-52073</guid>
		<description><![CDATA[I have tried all your work arounds to no avail. Our program is written in C++  and uses ODBC to connect to the SQL DB. All SQL works great with all versions of SQL Server  and ODBC drivers (7.0 and later) except 2008 using the SQL Server native Client 10 ODBC driver. SQL Server 2008 with Native Client 2005 ODBC driver also works fine. We are having a similair Scope_Identity issue but I believe it &#039;s different than outlined above. We even have issues using SQL 2008 Express (no parrallism used) using the SQL Server Native Client 10.

SQL Server ODBC Native Client 10 just can&#039;t grab the right Scope_Identity but  the 2005 Native Client is fine connecting to a SQL Server 2008 database with our application.

so we are successful in getting the correct Scope_Identity while using the application with ODBC driver SQL Server Native Client from 2005... the following commands were issued:

INSERT INTO BinaryImage (&quot;ImageSourceType&quot;,&quot;RetentionType&quot;,&quot;ImageSize&quot;,&quot;ImageDataCRC&quot;…

SELECT SCOPE_IDENTITY()  
SELECT ….  FROM &quot;BinaryImage&quot; WHERE BinaryImageNo=2514628

But with ODBC SQL Server Native Client 2008 the same insert looks like:

exec sp_executesql N&#039; INSERT INTO BinaryImage (&quot;ImageSourceType&quot;,&quot;RetentionType&quot;,&quot;ImageSize&quot;,&quot;ImageDataCRC&quot;…  

SELECT SCOPE_IDENTITY()  
SELECT ….  FROM &quot;BinaryImage&quot; WHERE BinaryImageNo=158731

            Note:  The BinaryImageNo should have been greater than 2,204,700



Thanks...

Phil S]]></description>
		<content:encoded><![CDATA[<p>I have tried all your work arounds to no avail. Our program is written in C++  and uses ODBC to connect to the SQL DB. All SQL works great with all versions of SQL Server  and ODBC drivers (7.0 and later) except 2008 using the SQL Server native Client 10 ODBC driver. SQL Server 2008 with Native Client 2005 ODBC driver also works fine. We are having a similair Scope_Identity issue but I believe it &#8216;s different than outlined above. We even have issues using SQL 2008 Express (no parrallism used) using the SQL Server Native Client 10.</p>
<p>SQL Server ODBC Native Client 10 just can&#8217;t grab the right Scope_Identity but  the 2005 Native Client is fine connecting to a SQL Server 2008 database with our application.</p>
<p>so we are successful in getting the correct Scope_Identity while using the application with ODBC driver SQL Server Native Client from 2005&#8230; the following commands were issued:</p>
<p>INSERT INTO BinaryImage (&#8220;ImageSourceType&#8221;,&#8221;RetentionType&#8221;,&#8221;ImageSize&#8221;,&#8221;ImageDataCRC&#8221;…</p>
<p>SELECT SCOPE_IDENTITY()<br />
SELECT ….  FROM &#8220;BinaryImage&#8221; WHERE BinaryImageNo=2514628</p>
<p>But with ODBC SQL Server Native Client 2008 the same insert looks like:</p>
<p>exec sp_executesql N&#8217; INSERT INTO BinaryImage (&#8220;ImageSourceType&#8221;,&#8221;RetentionType&#8221;,&#8221;ImageSize&#8221;,&#8221;ImageDataCRC&#8221;…  </p>
<p>SELECT SCOPE_IDENTITY()<br />
SELECT ….  FROM &#8220;BinaryImage&#8221; WHERE BinaryImageNo=158731</p>
<p>            Note:  The BinaryImageNo should have been greater than 2,204,700</p>
<p>Thanks&#8230;</p>
<p>Phil S</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-50970</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Tue, 14 Apr 2009 13:00:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-50970</guid>
		<description><![CDATA[Howard,

As far as I know they have not addressed this issue in SP1.

As far as I know they will address this in next release of SQL Server.

Kind Regards,
Pinal]]></description>
		<content:encoded><![CDATA[<p>Howard,</p>
<p>As far as I know they have not addressed this issue in SP1.</p>
<p>As far as I know they will address this in next release of SQL Server.</p>
<p>Kind Regards,<br />
Pinal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Howard Hoffman</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-50966</link>
		<dc:creator><![CDATA[Howard Hoffman]]></dc:creator>
		<pubDate>Tue, 14 Apr 2009 12:40:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-50966</guid>
		<description><![CDATA[Do we know whether MS has addressed this in SQL Server 2008 SP1?]]></description>
		<content:encoded><![CDATA[<p>Do we know whether MS has addressed this in SQL Server 2008 SP1?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dass</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-49925</link>
		<dc:creator><![CDATA[Dass]]></dc:creator>
		<pubDate>Wed, 25 Mar 2009 09:37:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-49925</guid>
		<description><![CDATA[thanks]]></description>
		<content:encoded><![CDATA[<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sinix</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-49914</link>
		<dc:creator><![CDATA[Sinix]]></dc:creator>
		<pubDate>Wed, 25 Mar 2009 06:32:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-49914</guid>
		<description><![CDATA[Hello, Dave! As I can see there are situations when identity_scope should return valid values:

a) insert ... values
b) insert ... select (no from clause, an invariant for statement above)
c) insert ... select ... with MAX_DOP=1 - as noted at feedback comments forces nonparallel query plans

but I&#039;m not sure that
 insert ... select top 1 ... --complex query goes here
will not result in parallel execution, as query optimiser could decide to make parallel index scan, for example.

So there are only two ways to insert single row &amp; return generated id: insert...maxdop=1 and insert...output.

The last one requires table variable, the first one supresses parallel plans. Which one will be more efficient? -- I perfectly understand there are no universal recomendations:)

Thanks!]]></description>
		<content:encoded><![CDATA[<p>Hello, Dave! As I can see there are situations when identity_scope should return valid values:</p>
<p>a) insert &#8230; values<br />
b) insert &#8230; select (no from clause, an invariant for statement above)<br />
c) insert &#8230; select &#8230; with MAX_DOP=1 &#8211; as noted at feedback comments forces nonparallel query plans</p>
<p>but I&#8217;m not sure that<br />
 insert &#8230; select top 1 &#8230; &#8211;complex query goes here<br />
will not result in parallel execution, as query optimiser could decide to make parallel index scan, for example.</p>
<p>So there are only two ways to insert single row &amp; return generated id: insert&#8230;maxdop=1 and insert&#8230;output.</p>
<p>The last one requires table variable, the first one supresses parallel plans. Which one will be more efficient? &#8212; I perfectly understand there are no universal recomendations:)</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Nadel</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-49874</link>
		<dc:creator><![CDATA[Ben Nadel]]></dc:creator>
		<pubDate>Tue, 24 Mar 2009 20:42:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-49874</guid>
		<description><![CDATA[Great post. I haven&#039;t used SQL 2008 yet, but this seems like a HUGE issues if you don&#039;t know about (and it would be a nightmare to correct)!]]></description>
		<content:encoded><![CDATA[<p>Great post. I haven&#8217;t used SQL 2008 yet, but this seems like a HUGE issues if you don&#8217;t know about (and it would be a nightmare to correct)!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Mittal</title>
		<link>http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/#comment-49824</link>
		<dc:creator><![CDATA[Roger Mittal]]></dc:creator>
		<pubDate>Tue, 24 Mar 2009 04:14:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3961#comment-49824</guid>
		<description><![CDATA[Hey Pinal

I wonder why I did not know it earlier. I have read this earlier on MS connect but I did not understand it there. Thanks for putting the same in simple words.

No wonder you are MVP. Do you work for Microsoft too.]]></description>
		<content:encoded><![CDATA[<p>Hey Pinal</p>
<p>I wonder why I did not know it earlier. I have read this earlier on MS connect but I did not understand it there. Thanks for putting the same in simple words.</p>
<p>No wonder you are MVP. Do you work for Microsoft too.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
