nal Message-
>From: Nick Slay [mailto:[EMAIL PROTECTED]]
>Sent: Friday, May 12, 2000 6:39 PM
>To: [EMAIL PROTECTED]
>Subject:RE: SQL Max record ID ?
>
>Although you can use this approach, the quickest method is to use a
>stored
>procedure to add the record,
ECTED]
Subject: RE: SQL Max record ID ?
Although you can use this approach, the quickest method is to use a
stored
procedure to add the record, an Identity column for the key (in SQL
Server
at least) and return that in the same stored procedure. SQL Server 6.5
was
meant to have an occas
]]
Sent: Friday, May 12, 2000 6:39 PM
To: [EMAIL PROTECTED]
Subject: RE: SQL Max record ID ?
Although you can use this approach, the quickest method is to use a stored
procedure to add the record, an Identity column for the key (in SQL Server
at least) and return that in the same stored procedure
oudreau [mailto:[EMAIL PROTECTED]]
>Sent: Friday, May 12, 2000 3:41 PM
>To: [EMAIL PROTECTED]
>Cc: [EMAIL PROTECTED]
>Subject:RE: SQL Max record ID ?
>
>Try this Nelson:
>
>
>
> insert into myTable1 ( . )
> values ( . )
>
>
&g
te.
Sean
-Original Message-
From: Duane Boudreau [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 12, 2000 3:41 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: SQL Max record ID ?
Try this Nelson:
insert into myTable1 ( . )
Try this Nelson:
insert into myTable1 ( . )
values ( . )
SELECT MAX(SomeID) AS NewSomeID
FROM myTable2
Using cftransaction insures that you get the newest SomeID inserted.
Duane Boudreau,
Project/Beta Manager, eMPower
Director, Web Technologies
Ektr
SELECT max(FIELD_NAME) AS maxid
FROM TABLE_NAME
...run this query immediately after you insert your record... Then use the
resulting data - #query_name.maxid# in your next query... Should probably
use cftransaction around the first two queries.
Hope this helps,
David J. Berger
Web Developer
7 matches
Mail list logo