ADO Quick Question

  • Thread starter Thread starter Doug
  • Start date Start date
D

Doug

Hi,

I have a quick question -

I have a table where the primary key is an autogenerated GUID via SQL Server
2k. The table has just 2 fields, the PK and the ChangeDate. When I do an
insert into the table w/ the date, the PK is generated, but I need to have
that PK value returned to the application for use elsewhere. Is there a way
to have this value returned to my application w/o having a routine that goes
back and gets it? I thought there was something, but I can't remember it.
Thanks.

Doug
 
William,

What i mean is once the record is inserted into the table, i need to get the
PK that was generated. I know i can create a new SQL statement to go back
to the table and select the record and grab the PK that was just created,
but I'd rather do a single trip (when i do the insert also return the newly
generated PK). Can you give me a quick example using the Output parameter?
Thanks.

Doug
 
William,

I forgot - I'm not using an insert statement, i'm using a DataSet and the
Update event so I can't piggyback a select statement w/ the Insert
statement.

Doug
 
Back
Top