DECLARE @lastname varchar(100)
DECLARE @firstname varchar(100)
DECLARE query_cursor CURSOR FOR
SELECT
LastName,
FirstName
FROM
T_AddressData
ORDER BY
PK_AddressData
OPEN query_cursor
FETCH NEXT FROM query_cursor
INTO @lastname, @firstname
PRINT '---------- Results ----------'
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT (@lastname + ' ' + @firstname)
FETCH NEXT FROM query_cursor
INTO @lastname, @firstname
END
CLOSE query_cursor
DEALLOCATE query_cursor
Tags: Cursor, SQL
This entry was posted on Mittwoch, November 4th, 2009 at 15:14 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 from your own site.