SQL Agent CmdExec

Hi, I am scheduling a SQL agent job, and uses CmdExec to execute a command below:
However it seems SQL agent job CmdExec doesn't recognize ">", and reports an error. May I ask how to write output with command in CmdExec step?  Don't want to use the advanced option to do it, as I have multiple lines and want to write to multiple output files.. Thanks a lot,

QUERY PROCESS * /server:servername >H:\Report\log.txt
Vivian_ShiAsked:
Who is Participating?
 
Vitor MontalvãoConnect With a Mentor MSSQL Senior EngineerCommented:
Try to use the "Output to File" option. You can configure it in the Job Step Advanced properties:
SQLJob_Output2File.PNG
1
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Recommendation to close this question by accepting the above comment as solution.
1
 
Vivian_ShiAuthor Commented:
Hi Vitor, it is nice to meet you again!! Thanks a lot for your help, and sorry I didn't come back to close the question earlier due to intermittent network restriction from my area.
Have a wonderful day!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.