plook
IS-IT--Management
- Apr 1, 2000
- 33
- 0
- 0
Hi all,
I have a newbie question in MS SQL 7
Let's start with the following statement
UPDATE cyber_pricing
SET pricing = 1,
description = 'blah blah',
stock = 'NO'
WHERE id = 12345
This will update the record id "12345" only if it exist,how could one insert the record if it does not exist ?
I mean, is there a better way to do it instead of doing a SELECT of that id before, count the record, if the count is 0 do an INSERT, otherwise (if count IS 1) do an UPDATE ?
Thanks
Plook
I have a newbie question in MS SQL 7
Let's start with the following statement
UPDATE cyber_pricing
SET pricing = 1,
description = 'blah blah',
stock = 'NO'
WHERE id = 12345
This will update the record id "12345" only if it exist,how could one insert the record if it does not exist ?
I mean, is there a better way to do it instead of doing a SELECT of that id before, count the record, if the count is 0 do an INSERT, otherwise (if count IS 1) do an UPDATE ?
Thanks
Plook