0

I want to create a procedure to update a table. It takes number of input parameters(one of them is the @pID) and updates four columns which have the pID=@pID and only one of these four columns can be updated if the value of another column='F' in addition to pID=@pID. How can I do this?
This is what I've got so far

CREATE PROCEDURE ABC (
@pID
@A INT,
@B CHAR,
@C CHAR,
@D VARCHAR)
AS
update EEE
set A=@A,
      B=@B,
      C=@C
WHERE pID=@pID

update EEE
set D=@D
Where pID=@pID AND G='T'
3
Contributors
4
Replies
6
Views
8 Years
Discussion Span
Last Post by sknake
0

the code which u ve written is correct for stored procedure, i dont really understand wats ur problem is....

0

You're welcome even though we didn't do much :)

Please mark this thread as solved since you have found a solution to your problem and good luck!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.