A lot of times, I put a field in my database that is the time
inserted.  Then what you can do is set a varaible before your insert
with the time you are going to insert, then do your insert using that
time, and then you can do a select with that time right after it.  If
you are using a timestamp field, the only way you should get a bad
record is if you had two inserts into that table at exactly the same
millisecond, and if you are worried about that, use another field that
you inserted as well in your where clause.


On 6/2/06, Ken <[EMAIL PROTECTED]> wrote:
> Hi. I am doing a Insert statement into my db, and immediately after
> the Insert I need to fetch the value of the field ID (Identity).
> I know I could do a Select Max(ID), but how else can I fetch the value
> of the last inserted record? DB: SQL 2000.
> Please help.
>
> - Ken.
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:242024
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to