Skip to Content

sp_helpdb output in command prompt unreadable

Hi

when i run sp_helpdb from windows command prompt, the output is not formatted as Columns

results are looking mixed in many rows

how can i format it in proper way.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • May 01 at 01:25 PM

    isql doubles the length of fields when it uses the UTF8 character set.

    Try specifying use of a single-byte character set like iso_1 with parameter -Jiso_1

    -bret

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 22 at 08:02 PM

    What client are you using?
    Perhaps the client is using a variable-width font instead of a fixed-width font like courier?
    (If you paste the output into Word and select courier as the font, do column values line up?)

    Is it that the lines are wrapping so there are multiple lines of output for each database?
    If using the isql client, you can specify a wider output with the -w parameter (like -w999).

    If neither of these ideas are the cause, a screenshot of what it actually looks like may be helpful.

    Cheers,

    -bret

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Bret

      if i tried to use W999 or W300 instead of -X (isql -Usapsa -SMPRD -W999) am getting the bellow error:

      Msg 1640, Level 16, State 2:Server 'MPRD':
      Adaptive Server requires encryption of the login password on the network.
      Msg 4002, Level 14, State 1:
      Server 'MPRD':
      Login failed.
      CT-LIBRARY error:
      ct_connect(): protocol specific layer: external error: The attempt to connect to the server failed.<br>

      The output look like this.

      db-format.png (30.5 kB)
  • Apr 24 at 06:32 PM

    Hi Yaso,

    -w and -X can be used together; don't drop the -X, add the -w.

    This output does look like the issue is isql wrapping at it's default screen width, so I think -w will resolve the issue.

    Cheers,

    -bret

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 25 at 10:38 PM

    Hi Yaso,

    Try making the terminal window wider and run the query again.

    -bret

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 30 at 04:35 PM

    This is a typical DOS window problem.

    Right click and change defaults for the DOS window. Save and then reopen the DOS window.

    I have attached the settings for options, font, layout and colors (background and text).

    Also use the -w1024 option for isql to make sure that columns are expanded as needed.

    HTH

    Avinash


    Add comment
    10|10000 characters needed characters exceeded

    • Hi Avinash

      there is a progress, but i have used -w10000 increasing the number the issue looks on dash lines ---- which is too long

      and causing the cols to don't fit

      however it looks better

      Regards

      dbv.png (5.4 kB)
  • May 02 at 09:18 PM

    Hi Yaso

    sp_helpdb output is not a simple table.

    However you can look the source SQL of sp_helpdb which is in database sybsystemprocs.

    You can borrow what you need out it and create your own version and name it sp__helpdb

    Note the two underscores in sp__helpdb.

    Leave the SAP provided sp_helpdb as it is.

    For any select statement you can also use sp_autoformat procedure to trim additional spaces.

    Also for string columns you may use left(<column>, nn) function to get trimmed version of output.

    I think with the two suggestions above you can get what you want.

    HTH

    Avinash

    Add comment
    10|10000 characters needed characters exceeded