468,556 Members | 2,287 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,556 developers. It's quick & easy.

MSSQL Script execute in .bat

7
Hi Guys, anyone out there who could help me with my problem?

I have created a .bat file that would execute the mssql script and give an .txt file as an output. The script run successfully except for the output, the output save as .txt file was not in order unlike the output that was derrived from the query analyzer. As I try to solve my problem I observe that the lines separating the header and the data was the cause of un-order format, the lines doubles its length when I use the .bat file to execute my script. I have tried using the substring syntax to limit the length but same results achieved. Could anyone help me to remove those line automatically when I run my .bat file?

Please see the outputs below. Thank you very much.

output from query analyzer

object_name counter_name
------------------------- -----------------------------------
SQLServer:Buffer Manager Buffer cache hit ratio
SQLServer:Buffer Manager Buffer cache hit ratio base

(2 row(s) affected)

ouput from .bat

object_name
counter_name
--------------------------------------------------
----------------------------------------------------------------------
SQLServer:Buffer Manager
Buffer cache hit ratio
SQLServer:Buffer Manager
Buffer cache hit ratio base
Oct 3 '06 #1
1 2949
Alfred
7
For anyone who will encounter same problem as I did, the solution for my problem was on the .bat file and not in MSSQL. I added the -W in the command in my .bat file.
Oct 4 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

By using this site, you agree to our Privacy Policy and Terms of Use.