Re: Getting result of odbc's INSERT INTO command
- From: Joe <joerider@xxxxxxxxx>
- Date: Sun, 24 Apr 2005 13:07:42 +0200
Mark Randall wrote:
The Select MAX(id) in this case seems dangerous to me.
If you are just using one connection you are a tad screwed really, the @@identity works on a connection by connection basis.
However, if it is just the single connection, are you passing them one by one from some sort of queue? If so you should add some sort of return to your query that automatically queries @@IDENTITY straight after any INSERT.
Otherwise, its time to start using multiple connections.
I see the problem in this example:
My program on connection 1: INSERT INTO ... SELECT MAX(id)...
But before SELECT MAX(id) is executed connection 2 could also insert a record with any other program (or manually by using SQL-Enterprise-Manager)
Does it make sense to fetch a Transaction over those to statements?
Joe .
- Follow-Ups:
- Re: Getting result of odbc's INSERT INTO command
- From: Mark Randall
- Re: Getting result of odbc's INSERT INTO command
- References:
- Getting result of odbc's INSERT INTO command
- From: Joe
- Re: Getting result of odbc's INSERT INTO command
- From: Severian [MVP]
- Re: Getting result of odbc's INSERT INTO command
- From: Joe
- Re: Getting result of odbc's INSERT INTO command
- From: Severian [MVP]
- Re: Getting result of odbc's INSERT INTO command
- From: Joe
- Re: Getting result of odbc's INSERT INTO command
- From: Mark Randall
- Getting result of odbc's INSERT INTO command
- Prev by Date: Re: Getting result of odbc's INSERT INTO command
- Next by Date: Re: Getting result of odbc's INSERT INTO command
- Previous by thread: Re: Getting result of odbc's INSERT INTO command
- Next by thread: Re: Getting result of odbc's INSERT INTO command
- Index(es):
Relevant Pages
|