以下例子中,#missing是一個tmp table
DECLARE this_cursor CURSOR FOR select XX from #missing OPEN this_cursor DECLARE @cde integer FETCH NEXT FROM this_cursor INTO @cde WHILE @@FETCH_STATUS = 0 BEGIN -- do something here print @cde -- get next value FETCH NEXT FROM this_cursor INTO @cde END CLOSE this_cursor DEALLOCATE this_cursor
No comments:
Post a Comment