You can get the message:
Server: Msg 16915, Level 16, State 1, Procedure sp_TransTrigger, Line 52
A cursor with the name 'md_cursor_1' already exists.
The statement has been terminated.
If you don't deallocate the cursor from memory. Especially if you execute twice within the same session...
SELECT
Assoc,
Proj,
SUM(CASE WHEN Cat='PROD' THEN Hours ELSE 0 END) as PROD,
SUM(CASE WHEN Cat='TAFW' THEN Hours ELSE 0 END) as TAFW,
SUM(CASE WHEN Cat='IDLE' THEN Hours ELSE 0 END) as IDLE
FROM MyTable
GROUP BY Assoc, Proj
Think the above should work, cannot test on this machine - Standard...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.