DECLARE Cur CURSOR FOR
SELECT AccountID, AccountName
FROM Account
OPEN Cur
FETCH FROM Cur
INTO @AccountID, @AccountName
WHILE @@FETCH_STATUS = 0
BEGIN
--Do your tasks here
FETCH FROM Cur
INTO @AccountID, @AcountName
END
CLOSE Cur
DEALLOCATE Cur
Saturday, November 14, 2009
Using cursor
at 12:00 AM
Labels: SQL Server, SQL Server Tip
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment