return multiple messages to client application

  • Hi,

    I have a procedure where after processing, i am required to send multiple message to calling application.

    For ex:

    create procedure test as

    (@a as int,

    @b-2 as int

    @C as int )

    /*

    some transformations */

    print 'variable a is' + @a;

    print 'variable b is' + @b-2;

    print 'variable c is' + @C;

    I am only providing a sample of return messages, but in reality there a lot more messages where a string and a parameter value need to concatenated.

    Unfortunately print is not allowing to concatenate parameter value.

    I can use RaiseError, but these messages are not really any error messages.

    i tried to concatenate all message and output it using OUT type parameter, but the length of all messages combined exceeds 10000 characters.

    Is there any other alternate to send these messages out to application?

  • vasuarjula (6/9/2014)


    Hi,

    I have a procedure where after processing, i am required to send multiple message to calling application.

    For ex:

    create procedure test as

    (@a as int,

    @b-2 as int

    @C as int )

    /*

    some transformations */

    print 'variable a is' + @a;

    print 'variable b is' + @b-2;

    print 'variable c is' + @C;

    I am only providing a sample of return messages, but in reality there a lot more messages where a string and a parameter value need to concatenated.

    Unfortunately print is not allowing to concatenate parameter value.

    I can use RaiseError, but these messages are not really any error messages.

    i tried to concatenate all message and output it using OUT type parameter, but the length of all messages combined exceeds 10000 characters.

    Is there any other alternate to send these messages out to application?

    Why in the world would you need to send that much information back? If you need that much data have your procedure return a resultset via select statement.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply