retreiving index ID after insert 
Author Message
 retreiving index ID after insert

I am inserting a row into a table.  The Primary key is update using the
before insert trigger.  I need to know the value of the Primary key for
use in further updates.

I thought of using the Max value, but I am concerned with what is
happening when another user inserts a record at the same time.  How do
I surely get the value of the primary key just inserted by my call and
not the primary key of another user?


Thanks

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Tue, 19 Mar 2002 03:00:00 GMT  
 retreiving index ID after insert
I can see only two normal solutions(SQL Server):


feature)
     Then after the INSERT statement was executed you can check just

2)Using GUIDs, that can be generated on client and sent together with the
INSERT statement.

Dmitri.


Quote:
> I am inserting a row into a table.  The Primary key is update using the
> before insert trigger.  I need to know the value of the Primary key for
> use in further updates.

> I thought of using the Max value, but I am concerned with what is
> happening when another user inserts a record at the same time.  How do
> I surely get the value of the primary key just inserted by my call and
> not the primary key of another user?


> Thanks

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Tue, 19 Mar 2002 03:00:00 GMT  
 retreiving index ID after insert
What about using the LastModified property?
Brian


Thu, 21 Mar 2002 03:00:00 GMT  
 retreiving index ID after insert


Quote:
> What about using the LastModified property?
> Brian

acorn:
There is not a LastModified property using ADO.  Any other suggestions?

Sent via Deja.com http://www.deja.com/
Before you buy.



Fri, 22 Mar 2002 03:00:00 GMT  
 retreiving index ID after insert
Dmitri:
Quote:
> I can see only two normal solutions(SQL Server):

acorn:
I am using Oracle not SQL Server.

Quote:

that
> feature)
>      Then after the INSERT statement was executed you can check just

> 2)Using GUIDs, that can be generated on client and sent together with
the
> INSERT statement.

acorn:

Quote:
> > I am inserting a row into a table.  The Primary key is update using
the
> > before insert trigger.  I need to know the value of the Primary key
for
> > use in further updates.

> > I thought of using the Max value, but I am concerned with what is
> > happening when another user inserts a record at the same time.  How
do
> > I surely get the value of the primary key just inserted by my call
and
> > not the primary key of another user?


> > Thanks

> > Sent via Deja.com http://www.deja.com/
> > Before you buy.

--
=================================
If I had a hammer I'd hammer.
=================================

Sent via Deja.com http://www.deja.com/
Before you buy.



Fri, 22 Mar 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. need ID from newly inserted record (altered by insert trigger on SQL server)

2. How to insert data from un-indexed tabel to indexed table

3. How do I retreive autonumber ID's from an ADO recordset after .addnew

4. Method to retreive computer ID

5. Method to retreive computer ID

6. Method to retreive computer ID

7. Method to retreive computer ID

8. Method to retreive computer ID

9. Method to retreive computer ID

10. Retreiving CPU ID?

11. Retreive current contact index from contact form

12. How do I retreive the current paragraph index number

 

 
Powered by phpBB® Forum Software