Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Posts
    65

    Unanswered: 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.

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    In the procedure - RAISERROR('your_text', <level int>, <state int>), in your front-end code - interrogate errors collection.

  3. #3
    Join Date
    Oct 2003
    Location
    Newcastle, Australia
    Posts
    51

    Re: Really easy stored proc question

    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'

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    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
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  5. #5
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    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 !!!
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •