question about how to handle if row exists
From: jayderk (jayderk_at_hotmail.com)
Date: 12/27/04
- Next message: Omar Rojas: "'System.TypeLoadException'"
- Previous message: Rajendra: "How to get GMT time"
- Next in thread: Jan Yeh_eMVP: "Re: question about how to handle if row exists"
- Reply: Jan Yeh_eMVP: "Re: question about how to handle if row exists"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 27 Dec 2004 10:25:51 -0600
Since this is not supported in SQLCE
"IF NOT EXISTS (SELECT customer_id FROM customer WHERE customer_id = '{0}')
INSERT INTO customer(customer_id,event_id) VALUES('{0}','{1}')
what is the recommended way of inserting new rows in the database with a
focus on efficiency?
a) do a try catch on the INSERT statement, if it fails do an UPDATE?
b) check if customer_id exists before trying to INSERT?
customer_id is a primary key
thanks in advanced.
Jay
- Next message: Omar Rojas: "'System.TypeLoadException'"
- Previous message: Rajendra: "How to get GMT time"
- Next in thread: Jan Yeh_eMVP: "Re: question about how to handle if row exists"
- Reply: Jan Yeh_eMVP: "Re: question about how to handle if row exists"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading