RE: Inserted Identity Values in SQL 2005



Thanks for your response. The query that attempts to retreive the identity
value (using the @@IDENTITY func) fails to return any rows. There is no
other error that we can see directly. Alternatively, if we copy the exact
same set of queries (i.e. the initial INSERT INTO... as well as the SELECT
[ID] FROM tablename WHERE [ID]=@@IDENTITY) within Query Anayzer (in SQL2005
on the production database) everything always works perfectly. This is why
we thought this may be something related to using ADO to run the queries.

We are concerned about making changes to articles on the production database
(i.e. changing identity range values) as you suggest since this could
significantly impact operation and use of the database which is currently
live. We'd really like to understand better why the queries execute
differently when using ADO (and why this is a problem that has arrisen only
within SQL 2005 and not the older 2000 version which was also part of a merge
replication). Please let me know if anyone has any other suggestions.
Thanks. -David

"Charles Wang[MSFT]" wrote:

Hi,
I understand that after your application was deployed in production
environment who has a SQL server 2005 merge replication, it sporadically
failled to retrive the new inserted identity values.
If I have misunderstood, please let me know.

Did you get incorrect identity values or enounter some exception errors?

This seems to be a SQL Server replication identity range issue. You may try
setting the identity_range to 1 to see if this helps.
Please refer to this article to change automatic identity range management
settings for an existing article in a merge publication.
How to: Manage Identity Columns (Replication Transact-SQL Programming)
http://technet.microsoft.com/en-us/library/ms146907(SQL.90).aspx

If you have any other questions or concerns, please feel free to let me
know.

Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications

If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.


Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
======================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================







.



Relevant Pages

  • Re: C2872 IServiceProvider ambiguous symbol - migrating C++/MFC App with /clr to Visual Studio 2
    ... Infinite thanks for yet another excellent response. ... "typedef interface IServiceProvider IServiceProvider;" ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Intermittent work in UI thread
    ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vc.mfc)
  • Re: Intermittent work in UI thread
    ... then the issue here is that you would have a timer handler something like ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vc.mfc)
  • Re: Abort a download
    ... response output finished. ... enough for the raw HTTP communication. ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Inserted Identity Values in SQL 2005
    ... This seems to be a SQL Server replication identity range issue. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.data.ado)