You can dynamically execute a sql string in a stored procedure:
SET @sql = 'SELECT * FROM table'
EXEC (@SQL)
Is it possible to declare a cursor for a dynmaically executed SQL string?
eg:
SET @sql = 'SELECT field FROM table'
DECLARE cursorTest CURSOR FOR
@sql
or something like that because the above doesn't work 😉