21
Oct
Oct
USE AdventureWorks
GO
DECLARE @ProductID INT
DECLARE @getProductID CURSOR
SET @getProductID = CURSOR FOR
SELECT ProductID
FROM Production.Product
OPEN @getProductID
FETCH NEXT
FROM @getProductID INTO @ProductID
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT @ProductID
FETCH NEXT
FROM @getProductID INTO @ProductID
END
CLOSE @getProductID
DEALLOCATE @getProductID
GO
This entry was posted
on Wednesday, October 21st, 2009 at 11:27 am and is filed under SQL Server.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or TrackBack URI from your own site.


