-
-
Save anonymous/946339532950dd08b6a1 to your computer and use it in GitHub Desktop.
Gratuitous cursor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @BeginPostDate NVARCHAR(10) | |
DECLARE @EndPostDate NVARCHAR(10) | |
DECLARE @cnt INT | |
DECLARE XCursor CURSOR LOCAL FORWARD_ONLY | |
FOR | |
SELECT | |
CONVERT(NVARCHAR, ReportFromDate, 101) AS BeginPostDate , | |
CONVERT(NVARCHAR, ReportToDate, 101) AS EndPostDate | |
FROM Dates.ReportingDates | |
WHERE IsActive = '1'; | |
BEGIN TRANSACTION; | |
SET @cnt = 0 | |
OPEN XCursor; | |
FETCH NEXT FROM XCursor INTO @BeginPostDate, @EndPostDate; | |
WHILE @@FETCH_STATUS = 0 | |
BEGIN | |
SET @Cnt = @Cnt + 1 | |
FETCH NEXT FROM XCursor INTO @BeginPostDate, @EndPostDate; | |
END; | |
CLOSE XCursor; | |
DEALLOCATE XCursor; | |
PRINT @BeginPostDate | |
PRINT @EndPostDate | |
PRINT @Cnt | |
EXECUTE Financials.CalculatePremium @BeginPostDate, @EndPostDate, 1300000, 999999999, 'App', 'domain\user' | |
COMMIT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment