I am doing some trouleshoot, can someone help me breakdown this statement below to help me understand clearly. For the most part the statement is select records and looping through the records. After the cursor is the INTO Statement inserting values into the variables below. Look at the bold print below.
SQL
FETCH NEXT FROM curDCS INTO @Jobnumber,@Phase,@Hours,@PayType,@TimeSheetDtlID SELECT @numLineSeqNumber = COUNT(1) + 1
FROM TimesheetDtl
WHERE TimeSheetHdrId = @TimeSheetHdrId
AND @TimesheetLineKey IS NOT NULL
DECLARE curDCS CURSOR
FOR SELECT Jobnumber,
Phase,
Hours,
PayType,
TimeSheetDtlId
FROM TimesheetDtl
WHERE TimeSheetHdrId = @TimeSheetHdrId
AND intTimeLineKey IS NULL
OPEN curDCS
FETCH NEXT FROM curDCS INTO @Jobnumber,@Phase,@Hours,@PayType,@TimeSheetDtlID

Manas MohapatraRank #182 · 13.2K reputationPosted Dec 23, 2015, 10:56 PM EST
David SmithRank #999 · 2K reputationPosted Dec 24, 2015, 7:15 PM EST