Is there a way to use cursors on dymanically created queries or has anyone other solutions in their bags?
[tt]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not underestimate the power of [!]Google[/!][/tt]
Code:
DECLARE deviceid_cursor CURSOR FOR
SELECT * FROM @TableName
OPEN deviceid_cursor
FETCH NEXT FROM deviceid_cursor INTO @DeviceKey
CLOSE deviceid_cursor
DEALLOCATE deviceid_cursor
[tt]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not underestimate the power of [!]Google[/!][/tt]