Being a novice, I had a question that is helping me troubleshoot something I'm working on.
With the table created below, is there a way to modify the stored procedure to update multiple rows in the table
CREATE TABLE AccountTable
(
RowID int IDENTITY(1, 1),
AccountID varchar(2),
AccountName varchar(50),
SeqNum int,
SeqDate datetime
)
CREATE PROCEDURE [ACCOUNTTABLE_UPDATE]
(
@SeqNum int,
@SeqDate datetime,
@Account_ID varchar(2)
)
AS
SET NOCOUNT ON
BEGIN
UPDATE AccountTable
SET SeqNum = @SeqNum, SeqDate = @SeqDate
WHERE AccountID = @AccountID
END
EXEC ACCOUNTTABLE_UPDATE SeqNumValue, SeqDateValue, AccountIDValue
Running the stored procedure manually will of course edit one row, adding more values will lead to a too many arguments error. I just wanted to see if this stored procedure can in fact update more than one row in the table or if this should be modified to in fact handle providing more than the 3 parameters.