This is the stored procedure that I have input:
SQL |
SQL |
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Krishna GaradRank #191 · 12.8K reputationPosted Feb 8, 2011, 2:48 AM EST
Becky Bloomwood110 reputationPosted Feb 8, 2011, 2:59 AM EST
Micke BlomqvistRank #1,660 · 923 reputationPosted Feb 8, 2011, 4:53 AM EST
Just as Krishna says, you are just replacing the the existing values. Try to comment the select clause just running the update part.
The select clause is what is giving you a hard time!
Becky Bloomwood110 reputationPosted Feb 8, 2011, 5:38 AM EST
Micke BlomqvistRank #1,660 · 923 reputationPosted Feb 8, 2011, 7:09 AM EST
Select itemName, itemDesc from OS.Items WHERE itemID = @itemID
Replacing @itemID with the same parameter as from your C# code, do you get a hit on an item?
(Perhaps you need to trim your variable, taking away spaces???)
Suthish NairRank #92 · 22.8K reputationPosted Feb 8, 2011, 9:49 AM EST
UPDATE OS.Items SET itemName = @itemName , itemDesc = @itemDesc WHERE itemID = @itemID
why you need a select query. what kind of logic you want to apply.
you want to retrive history records or something else.
provide more information, so we can help.
Becky Bloomwood110 reputationPosted Feb 8, 2011, 12:46 PM EST
ALTER PROCEDURE [OS].[UPDATE_ItemsRecords]
@itemID varchar(10),
@itemName varchar(1000),
@itemDesc varchar(10)
AS
UPDATE OS.Items SET itemName = @itemName , itemDesc = @itemDesc WHERE itemID = @itemID
I have modify to become the one that you guys suggested but the records still remains the same. Thanks!
Becky Bloomwood110 reputationPosted Feb 8, 2011, 12:48 PM EST