RE: SQL Max record ID ?

2000-05-13 Thread Nick Slay
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,

RE: SQL Max record ID ?

2000-05-12 Thread Leyne, Sean
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

RE: SQL Max record ID ?

2000-05-12 Thread Chris Evans
]] 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

RE: SQL Max record ID ?

2000-05-12 Thread Nick Slay
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

RE: SQL Max record ID ?

2000-05-12 Thread Leyne, Sean
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 ( . )

RE: SQL Max record ID ?

2000-05-12 Thread Duane Boudreau
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

Re: SQL Max record ID ?

2000-05-12 Thread David Berger
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