SQL Server 2005 Agent – Job output problem | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

SQL Server 2005 Agent – Job output problem

Hi guys!
I have a specified text format output file created in SQL Management studio, it has a corresponding result in it, but after I scheduled it via SQL Agent as a Job,
the ODBC(? I don’t know exactly) insert a [SQLSTATE 01000] message after every row and ‘statistics’ in the first row, so it looks like this (a part of the .txt): Job ‘OLASGL_IF’ : Step 1, ‘OLASGL_IF’ : Began Executing 2007-05-17 14:52:41 1DE200702EUR559000009085463022000008999527463 [SQLSTATE 01000]
2C02010TWO 000000001327942- [SQLSTATE 01000]
2C04081FOU8PWA0000000265200000- [SQLSTATE 01000]
2C04122TWO 000000003435390+ [SQLSTATE 01000] So, how can I eliminate or get rid of these, because it should be sent forward via ftp to an another system!?
Please, Somebody help me! It would be very important because of the dedline of my task!!!!

What is generating this ouput….is there any select statement?
If it is select statement then you can run as OSQL and write to output file… MohammedU.
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.

Can I use OSQL in server 2005, if I know well insted of it I have to use sqlcmd, but
it causes some problem for me, because I haven’t used it before… so, for example can I schedule it as I need to?
Of course I use select statements, but make the output with cursor and print statement(because of specializing of the output format) in my sql_query.
So can you explain your conception in more details, during an example for instance?
Thanks in advance!!
OSQL still works in 2005 and it will not be there in future versions becuase it is depricated…
You can use SQMCMD instead of OSQL and it can be scheduled as job.. You can create a table with single and insert your print statements into that tables once your cursor process is finished you can use SQLCMD OR OSQL to send the output to a file or you can SSIS package too…
MohammedU.
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.

]]>