Unexpected Return Value

  • I'm developing a procedure that reads a row and, if it is not null, concatenates it sentence to a variable declared as @Narrative_Text nvarchar(4000).  Although this is a function I converted it to a stored procedure for troubleshooting, placed some print statements in the WHILE loop to see what the value of @Narrative_Text during the loop.  It looks great until I either SELECT or RETURN the value of @Narrative_Text.  The returned value appears to be truncated at 256 characters.  I'm confused why a declared variable would only return 256 characters.  Any assistance explaining this or helping me get the correct value would be appreciated.

     

  • Not sure what your specific problem is, but you may be talking about query analyzer only showing 256 characters of the result.  If that's the case modify max characters per column in the options menu.

  • Thanks!  I knew when the PRINT and RETURN statements both returned different values it was something simple but it never occurred to me that the options menu allowed me to set the maximum characters per column.  But then it makes sense as query analyzer doesn't wrap text.

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

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