Declare @Id NVARCHAR(36)
Declare @Name NVARCHAR(36)

DECLARE cur CURSOR FOR
SELECT Id,Name FROM TABLE
OPEN cur 
FETCH next FROM cur INTO @Id,@Name
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT @Id + @Name
FETCH next FROM cur INTO @Id,@Name
END 
CLOSE cur
DEALLOCATE cur
posted on 2010-07-30 12:30  尚書  阅读(215)  评论(0编辑  收藏  举报