David Smith

David Smith

  • NA
  • 2k
  • 0

SQL SERVER INTO ??

Dec 24 2015 3:16 AM

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.


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
      

Answers (2)