|
The stored procedure does not matter C# and VB, both are SQL SERVER
Write successfully, call with C#
Do it with a name
create proc proc1
@prod_id varchar(10)
as
if exists(select prod_id from prod where prod_id = @prod_id)
--Perform update operation
begin
update prod set num = num + 1
end
else
- Perform an insert operation
begin
insert into prod(prod_id,num) values(@prod_id,1)
end |
|