Re: How to determine GUID of newly-inserted record?
- From: "Joćo Paulo Figueira [eMVP]" <joao.figueira@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 26 Oct 2005 08:56:49 +0100
You may also generate the GUIDs yourself and remove the IsRowGuid property
from the columns. This way, you would know the GUID value before inserting
into the table.
--
João Paulo Figueira
Embedded MVP
http://nativemobile.blogspot.com/
"PGallez" <PGallez@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:50AD7B1D-A22E-4009-ADC4-56E413EBA6D5@xxxxxxxxxxxxxxxx
> I'm doing merge replication between SQL Server 2000 and CE running on a
> PDA.
> The PK of the tables are all uniqueidentifiers with a default value of
> newid() and the IsRowGuid property set to true.
>
> Immediately after application code running on the PDA executes an INSERT
> statement, I need to determine the PK value (a GUID) of the newly-inserted
> record. How can I do this?
>
> Since the tables currently also include an identity column, my initial
> solution was to query the database for the PK of the record with the
> maximum
> identity value (which would be the most recently inserted record)
> immediately
> after inserting the record; however, I intend to drop the identity columns
> due to problems managing ranged identities, so even if this solution
> worked
> reliably (it doesn't), it won't work after I drop the columns. Besides,
> it's
> kludgy.
>
> So, any suggestions re how to determine the PK GUID of a record just
> inserted via code?
.
- Prev by Date: Re: SQL Ce Merge Replication question
- Next by Date: Re: SQL Ce Merge Replication question
- Previous by thread: Re: How to determine GUID of newly-inserted record?
- Next by thread: Re: How to determine GUID of newly-inserted record?
- Index(es):
Relevant Pages
|
|