Created
March 1, 2016 02:00
-
-
Save radityopw/711545dd7c00e9a15492 to your computer and use it in GitHub Desktop.
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
set nocount on | |
use AdventureWorks2012 | |
go | |
declare @total money | |
declare @cursor CURSOR | |
set @cursor = cursor for | |
select top 10 TotalDue | |
from sales.SalesOrderHeader | |
order by SalesOrderID desc | |
open @cursor | |
fetch next from @cursor into @total | |
while @@FETCH_STATUS = 0 | |
begin | |
print 'total :'+cast(@total as varchar) | |
fetch next from @cursor into @total | |
end | |
close @cursor | |
deallocate @cursor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment