G
Guest
Hi
I am using one SP to perform updation as well as insertion on a table in SQLSvr2000. But somehow, the control seems to be going to the Insertion part of the procedure. This is how i have defined the SP (icode is defined as identity, primary key)
CREATE PROCEDURE dbo.[UpdtMaster]
@whattodo int
@icode int
@iname nchar(100),
A
declare @trans_err in
if @whattodo =
begin
Update ItemMaste
Set Itemname = @iname,
where itemcode = @icod
end
els
begi
Insert into ItemMaste
(itemname)
values (@iname
end
G
In the corresponding vb.net snippet, i am doing a call as follows
MyDA.UpdateCommand.Parameter.Add("@whattodo", sqldbtype.int, 4).value =
I am using one SP to perform updation as well as insertion on a table in SQLSvr2000. But somehow, the control seems to be going to the Insertion part of the procedure. This is how i have defined the SP (icode is defined as identity, primary key)
CREATE PROCEDURE dbo.[UpdtMaster]
@whattodo int
@icode int
@iname nchar(100),
A
declare @trans_err in
if @whattodo =
begin
Update ItemMaste
Set Itemname = @iname,
where itemcode = @icod
end
els
begi
Insert into ItemMaste
(itemname)
values (@iname
end
G
In the corresponding vb.net snippet, i am doing a call as follows
MyDA.UpdateCommand.Parameter.Add("@whattodo", sqldbtype.int, 4).value =