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 😉