Re: Getting result of odbc's INSERT INTO command



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.
.



Relevant Pages

  • Re: Getting result of odbcs INSERT INTO command
    ... > module is using only one connection to serve multiple clients. ... If you are just using one connection you are a tad screwed really, ... If so you should add some sort of return to ... your query that automatically queries @@IDENTITY straight after any INSERT. ...
    (microsoft.public.vc.language)
  • Re: Great Restaurant in Miami - next time you are in South Florida
    ... Zakariya, in front of databases ... cosmetic and immediate, fixs in connection with it, noticing ...
    (sci.crypt)
  • Re: IIS6 Dynamic pages execusion problem
    ... I'm sure that connection objects to databases are closed probably and the ... "Rany M. Sabry" wrote in message ... > I have a number of Web Servers running IIS6 hosted on Windows 2003 ...
    (microsoft.public.inetserver.iis)
  • Re: Switching ODBC Oracle databases
    ... Also is there something in the connection string I am using that causes ODBC ... "Lynn Trapp" wrote: ... databases in the 10th and then you would only have to create the single ODBC ...
    (microsoft.public.access.externaldata)
  • Re: Word not responding
    ... Suzanne S. Barnhill ... "ike" wrote in message ... > connection on until I find a better solution. ... >>Microsoft MVP ...
    (microsoft.public.word.application.errors)