• This procedure has been migrated from Oracle. Returning a cursor from a stored procedure is a common pattern in Oracle, but much less common in SQL Server.

    This is because Oracle stored procedures cannot return a result set, while SQL Server stored procedures can. Change the code to return the data instead of the cursor.

    -- Gianluca Sartori