Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have the following codes, how can i loop through the result set returned?

SQL
SELECT @sql = (SELECT dbo.CRF_Project.DocStatus from vsCustomizationRequest.dbo.CRF_Project where CustomerID = '1') --this is the result returned from a table

        --loop start here
        IF(@sql = '0')
            SET @row = CONVERT(INT,(COUNT(@sql)))
            SET @ColumnName = 'sta0'
            SET @statement = 'UPDATE ['+@TABLE+'] SET '+@ColumnName+' = '''+@row+''''

            EXEC @statement
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900