I'm trying to put the results of a stored procedure into a cursor to use within the current procedure. I've added my code below but I'm not sure if this is possible or if my syntax is correct?

DECLARE cursorIDList CURSOR FOR
    EXEC spGetUserIDs
OPEN cursorIDList

FETCH NEXT FROM cursorIDList INTO @ID

I receive the following error: Incorrect syntax near 'EXEC'. Expecting SELECT, '(' or WITH.

Thanks in advance.

Edit
Report