Re: Getting result of odbc's INSERT INTO command
- From: "Severian [MVP]" <severian@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 24 Apr 2005 17:19:42 GMT
On Sun, 24 Apr 2005 11:30:05 +0100, "Mark Randall" <markyr@xxxxxxxxx>
wrote:
>"Joe" wrote:
>> My problem is that other clients could add records in the meantime. My
>> module is using only one connection to serve multiple clients. So I can
>> use a lock.
>>
>> 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.
Is @@IDENTITY standard SQL? Does it work with both JET and SQL Server
databases?
It looks like a Microsoftism to me, which is perfectly fine if you
never want your code to be compatible with other databaess.
--
Phillip Crews aka Severian
Microsoft MVP, Windows SDK
Posting email address is real, but please post replies on the newsgroup.
.
- 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: const string leaks?
- 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
|