﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Larry Sumuri  / Serial ID Auto Generation / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 18 May 2013 16:11:40 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Serial ID Auto Generation</title><link>http://www.sqlservercentral.com/Forums/Topic860943-2604-1.aspx</link><description>Thanks Folks, for all the good suggestions and corrections, I will check out the link and rewrite the script to cater for the scenarios mentioned and post again here for more reviews.</description><pubDate>Tue, 23 Feb 2010 15:42:19 GMT</pubDate><dc:creator>Larry Sumuri-373443</dc:creator></item><item><title>RE: Serial ID Auto Generation</title><link>http://www.sqlservercentral.com/Forums/Topic860943-2604-1.aspx</link><description>I like Nigel's suggestion, comments.  Check out the stuff by Jeff.</description><pubDate>Tue, 23 Feb 2010 08:54:54 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: Serial ID Auto Generation</title><link>http://www.sqlservercentral.com/Forums/Topic860943-2604-1.aspx</link><description>The article I was thinking of is [url=http://www.sqlservercentral.com/Forums/Topic817978-145-1.aspx][u][b]here[/b][/u][/url]. The key piece of information is in Jeff Modens reply, where he uses an UPDATE with (UPDLOCK).See [url=http://www.google.co.uk/search?q=UPDATE+WITH+UPDLOCK][u][b]here[/b][/u][/url] for more info.</description><pubDate>Tue, 23 Feb 2010 03:46:29 GMT</pubDate><dc:creator>nigel.</dc:creator></item><item><title>RE: Serial ID Auto Generation</title><link>http://www.sqlservercentral.com/Forums/Topic860943-2604-1.aspx</link><description>A couple of issues here: 1. Concurrency - wrapping your code in a transaction is not going to ensure that it cannot be executed concurrently by two or more processes, resulting in potential duplicates being generated. The line                [quote]SET @CurrentSID = (SELECT [SID] FROM [RefVal_SerialID])[/quote]could very easily be executed by two processes and get the same result.There was a post on this very topic somewhere here recently when I find it I'll post the link. 2. Left padding with zeroes  - don't need all those IF's, just do it like this:[quote]SELECT RIGHT('0000000000' + cast(someInt as varchar(50)),10) [/quote] </description><pubDate>Tue, 23 Feb 2010 03:09:04 GMT</pubDate><dc:creator>nigel.</dc:creator></item><item><title>Serial ID Auto Generation</title><link>http://www.sqlservercentral.com/Forums/Topic860943-2604-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/Serial+ID/69528/"&gt;Serial ID Auto Generation&lt;/A&gt;[/B]</description><pubDate>Fri, 05 Feb 2010 17:32:49 GMT</pubDate><dc:creator>Larry Sumuri-373443</dc:creator></item></channel></rss>