question

tpkhoa avatar image
tpkhoa asked

Cannot run echo command in SQL cmdexec

Dear all, I have a problem when creating SQL job in cdmexec job. My job as following: 1. Create job. 2. Choose step as cmdexec, this stepp to call .bat file. code of bat file:

ECHO begin                     
REN C:\test.txt test1.txt                     
ECHO end                    

The problem I met that the job status was success, but the message in the ECHO commands not show (the command line window not dispaly). How can I show the msg of ECHo command? Please help me!

sql-server-2000sql-agentjob
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
graz avatar image
graz answered

When you run a job inside SQL Server Agent I don't think you'll ever see the window. In the Advanced Properties of the step you can set an output file for the step. That should hold the results of the ECHO command.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.