Actually what I do more frequently nowdays is use createUUID() to
generate a primary key of my own and insert that instead of using
identity fields.  All of these issues go away then.

The only reason I use identity fields nowdays is if I think it's
likely I might have to be typing queries out in the query editor 
using the primary key on a regular basis.

Cheers
Mike Kear
Windsor, NSW, Australia
Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month



On 4/5/06, Munson, Jacob <[EMAIL PROTECTED]> wrote:
> > SELECT IDENT_CURRENT('tablename ')   which returns the latest identity
> > in the table name in question.  That also prevents getting the
> > identity of the wrong table in the event of the query being used as
> > part of a trigger which affects multiple tables.
>
> Unless someone has created a new record after your insert, then you'll
> get their identity instead.  SCOPE_IDENTITY, on the other hand, returns
> the last identity value generated for any table in the current session
> and the current scope.  So with one, you might get someone else's
> identity, and with the other you might get the wrong table.  Can we ever
> win?  :)
> I guess you could do both methods and compare the results, just to be
> sure.
>
> ------------------
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236956
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to