Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Query then insert or update recordset


Message #1 by "Anthony Yates" <anthony.yates@a...> on Tue, 16 May 2000 17:27:35
I have an "add, change, delete" application for user details. I use Visual 

InterDev Recordet Design Time Controls to connect to a SQL Server database 

using stored procedures.

Before inserting a record I want to see if it already exists. If it does, I 

want to retrieve it to update it. If not, I want to create a new one.

What is the most effective sequence of recordsets to do this? Do I query it 

first, then do an insert or create depending on the return? Or can I try an 

update with the key parameter, then do an insert if the update fails with a 

not-found error?

Thanks,

Anthony Yates


  Return to Index