1 DECLARE @dummy VARCHAR(50)
2 DECLARE @myOutput VARCHAR(50)
3
4 DECLARE db_cursor CURSOR FOR
5 SELECT fieldName
6 FROM tableName
7
8 OPEN db_cursor
9 FETCH NEXT FROM db_cursor INTO @dummy
10
11 WHILE @@FETCH_STATUS = 0
12 BEGIN
13 SET @myOutput = @dummy
14 PRINT @myOutput
15 FETCH NEXT FROM db_cursor INTO @dummy
16 END
17
18 CLOSE db_cursor
19 DEALLOCATE db_cursor
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.