> Does anyone have any Coldfusion code to insert a new 
> autoincrement key field in to a MS SQL table and then
> remove the old one?  Or is there a way to modify a key 
> field to autoincrement? 

If you're just running into occasional collisions, you could use <cflock>
with an exclusive lock to limit that part of the code so that it can only be
run by one thread at a time (others will get queued up and wait for the
first to complete.

If you do want to switch to an autonumber field, if you're running SQL
Server, you'll need to switch the field to be an identity column.  I
generally use Enterprise Manager to make these kinds of changes so I don't
have the code.  There is another related discussion at
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=65257 with some info that
may or may not help you out.


-Justin


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321863
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to