Lines of text in Output Window are truncated to 256 characters

Last post 11-05-2007 4:14 PM by pgrealy. 4 replies.

Sort Posts:

  • Lines of text in Output Window are truncated to 256 characters

    11-02-2007, 6:19 PM
    • Member
      60 point Member
    • pgrealy
    • Member since 03-09-2005, 12:33 PM
    • Houston. TX
    • Posts 15

    Hi,
    If I execute a stored procedure in VS 2005 that generates long lines of output they are truncated at 256 character maximum. Is there a way to increase this limit?
    Thanks,
    Pat G.

  • Re: Lines of text in Output Window are truncated to 256 characters

    11-03-2007, 12:55 PM

    Which API do you use to output strings in question?

    Thanks

    ------------------------------------------------------------

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Lines of text in Output Window are truncated to 256 characters

    11-05-2007, 1:07 PM
    • Member
      60 point Member
    • pgrealy
    • Member since 03-09-2005, 12:33 PM
    • Houston. TX
    • Posts 15

    Re-reading my original post, I was not very clear about waht I am doing. While in VS 2005, I am opening our SQL 2003 server in ServerExplorer and chooisng a stored procedure from one of our databses. I then right-click and execute. We have stored procedures that read through some tables and auto-generate some lines of code. It shuold generate some asp code and vb code to cut-and-paste into asp.net forms I am developing. This works well except for some very long lines. The procedure below is a simplified demonstration of the problem:

    = = = = =
    SET QUOTED_IDENTIFIER OFF
    GO
    SET ANSI_NULLS OFF
    GO
    ALTER             PROC dbo.xsp_PGtest
    AS

    CREATE TABLE #ScriptFile
     (LineText varchar(350))

    INSERT INTO #ScriptFile
     (LineText)
     SELECT CHAR(13)
      +  'Line 1:xx1xxxxxxxxx2xxxxxxxxx3xxxxxxxxx4xxxxxxxxx5'
      + 'xxxxxxxxx6xxxxxxxxx7xxxxxxxxx8xxxxxxxxx9xxxxxxxx00'
      + 'xxxxxxxxx1xxxxxxxxx2xxxxxxxxx3xxxxxxxxx4xxxxxxxxx5'
      + 'xxxxxxxxx6xxxxxxxxx7xxxxxxxxx8xxxxxxxxx9xxxxxxxx00'
      + 'xxxxxxxxx1xxxxxxxxx2xxxxxxxxx3xxxxxxxxx4xxxxxxxxx5'
      + 'xxxxxxxxx6xxxxxxxxx7xxxxxxxxx8xxxxxxxxx9xxxxxxxx00'

    INSERT INTO #ScriptFile
     (LineText)
     SELECT  CHAR(13) 
      + 'Line 2:xx1xxxxxxxxx2xxxxxxxxx3xxxxxxxxx4xxxxxxxxx5'
      + 'xxxxxxxxx6xxxxxxxxx7xxxxxxxxx8xxxxxxxxx9xxxxxxxx00'
      + 'xxxxxxxxx1xxxxxxxxx2xxxxxxxxx3xxxxxxxxx4xxxxxxxxx5'
      + 'xxxxxxxxx6xxxxxxxxx7xxxxxxxxx8xxxxxxxxx9xxxxxxxx00'
      + 'xxxxxxxxx1xxxxxxxxx2xxxxxxxxx3xxxxxxxxx4xxxxxxxxx5'
      + 'xxxxxxxxx6xxxxxxxxx7xxxxxxxxx8xxxxxxxxx9xxxxxxxx00'

    SELECT *
    FROM #ScriptFile

    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    SET ANSI_NULLS ON
    GO
    = = = = =
    What this should do is store two lines of 300 characters each in a temporary table and then display the contents of the table to the output window. This runs ok in SQL Query Analyzer with output selected to TEXT and the Tools/Options/Results "Maximum characters per column" set to 350. However, I cannot find a similar option to increase the line size of the Output window in VS 2005.
    Thanks,
    Pat G.

  • Re: Lines of text in Output Window are truncated to 256 characters

    11-05-2007, 3:28 PM

    I don't think it is VS fault really. Output window simply captures what is output via Win32 OutputDebugString API (which is not limited by length). However, if application that costructs strings before calling the mentioned API has a fixed buffer for the string construction, the string will be truncated. Is string getting chopped off or simply wrapped?

    Thanks

    ------------------------------------------------------------

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Lines of text in Output Window are truncated to 256 characters

    11-05-2007, 4:14 PM
    • Member
      60 point Member
    • pgrealy
    • Member since 03-09-2005, 12:33 PM
    • Houston. TX
    • Posts 15

    The string gets chopped off. If I enable line wrapping, the line wraps at the right edge of the output window but the second line still gets chopped at the same character position.

Page 1 of 1 (5 items)