Well i want to begin saying that i have spend a couple of hours trying to understand how to add a static view to this cursor but i really dont understand the real functionality of the cursors, so i came here to beg for some advices. This is a similar to what im using, so i hope is clear enough.
DECLARE @name VARCHAR(50),
@last_name VARCHAR(50)
DECLARE C_People CURSOR GLOBAL
FOR
SELECT name, last_name
FROM People
OPEN C_People
FETCH C_People INTO @name , @last_name
WHILE(@@FETCH_STATUS = 0)
BEGIN
PRINT 'Hello ' + @name + ' ' + @last_name
FETCH C_People INTO @name, @last_name
END
CLOSE C_People
DEALLOCATE C_People
GO