on 04-22-2019 6:20 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yaso,
Try making the terminal window wider and run the query again.
-bret
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.