Becky Bloomwood

Becky Bloomwood

  • NA
  • 119
  • 285.8k

Retrive and update existing record from database

Feb 8 2011 7:44 AM

Hi, I am using MS SQL Server 2008 to create a stored procedure that is responsible for retrieving and updating existing record from database. However, it does not update the records. I am not sure of what is wrong with the stored procedure.
This is the stored procedure that I have input:
 

ALTER
PROCEDURE [OS].[UPDATE_ItemsRecords]
@itemID
varchar(10),
@itemName  
varchar(1000),
@itemDesc
varchar(10)

AS
Select
@itemName = itemName, @itemDesc = itemDesc from OS.Items WHERE itemID = @itemID
UPDATE OS.Items SET itemName = @itemName , itemDesc = @itemDesc WHERE itemID = @itemID
I am unable to retrive and update the existing records. How do I resolve it?Thks!

Answers (8)