In Sql Server 2005+ you can retrieve the primary key of the last inserted record by using SELECT @@IDENTITY
This can then be used to update the row Thanks & Regards Taleeb Anwar *Hum Mashriq Ke "Miskeenon" Ka Dil Maghrib men Ja Atka Hai!!* On Fri, Mar 9, 2012 at 4:57 PM, Christoph P.U. Kukulies <[email protected]>wrote: > I'm using System.Data.SQLite and the following problem comes up: > > I'm doing an INSERT of some columns in a TABLE. I have to determine now if > the INSERT was successful. I'm doing this by putting the INSERT in a try { > do the insert...and try the UPDATE } catch { do nothing}; > > In case the INSERT fails because of a KEY clash the UPDATE isn't executed > either. > But in case the INSERT is successful I would like to do the UPDATE right > afterwards on the same ROW that has been inserted last. > You may argue, why I don't try the full INSERT right away. Reason: a large > BLOB has to be read inand the statement be prepared. > And I could safe that, if the INSERT would fail anyway. > > Is there something like UPDATE into last ROW that has been inserted? > > -- > Christoph > > > > ______________________________**_________________ > sqlite-users mailing list > [email protected] > http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users> > _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

