views:

156

answers:

1

I'm calling Sqlcommand.ExecScalar() - stepping through the stored proc works fine, right under

RETURN @RecordNum

@RecordNum correctly contains a bigint, as scoped. When I step into the RETURN.. I get an exception thrown, that visual studio does not seem to be able to capture.

The stored procedure works fine when executed directly, and returns a value without problem, and it seems like all is well, stepping through it from my code.

But as soon as I step into 'RETURN @RecordNum' (and recordnum contains a valid number..) BOOM! EXCEPTION! (and no details in the exception either back in visual studio.

I'm blaming a glitch in the matrix.. but any suggestions out there?

I've turned off even assigned the return from the ExecScalar to anything, same result.. I've tried ExecReader(), same result. I have turned NO COUNT on and off, same result. If I wasn't already bald, I would be now!

+1  A: 

Change it to SELECT @RecordNum

Joel Coehoorn
Off to try that now.. makes perfect sense that it would be something like that. I how I despise MS-SQL .. did I mention that this stored proc is over 450 lines of pure hell ;)
yeah, that didn't work :(