Saturday, February 25, 2012

Really easy stored proc question

I suppose it's not possible to return a varchar value from a stored proc? I keep getting a conversion error.
How can I return a varchar value, then?
Thanks.. sorry for the stupid question. I did some searching on Google and didn't find much.In the procedure - RAISERROR('your_text', <level int>, <state int>), in your front-end code - interrogate errors collection.|||Originally posted by MDesigner
I suppose it's not possible to return a varchar value from a stored proc? I keep getting a conversion error.

How can I return a varchar value, then?

Thanks.. sorry for the stupid question. I did some searching on Google and didn't find much.

Sounds like you want to use an output parameter in your stored proc

Search SQL Server help on 'output parameters'|||That's right...return can only return an int...use return only to determine the success or failure of a sproc...

use output variable to return values...like:

CREATE PROC mySproc99 @.inputParam varchar(10), @.outputParam varchar(255) OUTPUT
AS|||Originally posted by rdjabarov
In the procedure - RAISERROR('your_text', <level int>, <state int>), in your front-end code - interrogate errors collection.

Hey .. what are you talking about here !!!:confused: :confused: :confused:

No comments:

Post a Comment