Updating table with looped stored proc using cursor
Here's the problem:
I have a temporary table (basketuploads) with jobid, filename, userid. I
have a main table (jobs) with jobid, userid, reportname, jobstatus.
I need to update the main table by setting jobs.reportname = basketuploads.filename,
jobs.jobstatus = '6' where jobs.jobid = basketuploads.jobid and jobs.userid
I then delete all records for that userid.
The problem is that I need to loop thru the table. How do I do this with
I have the following stored proc:
CREATE PROCEDURE AdminBasketClearDetails
set nocount on
declare @userid varchar(50)
declare @labID Int
set @userid = (select locationemail from userlog where sessionid = substring(@SessionID,1,40))
set JobStatus = 6
Delete From BasketUploads
Where UserId = @UserID
I'd appreciate it greatly if you could help with this one.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center