x

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!

more ▼

asked Jan 26 '10 at 04:11 AM in Default

tpkhoa gravatar image

tpkhoa
1 1 1 1

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Jan 26 '10 at 10:54 AM

graz gravatar image

graz ♦
525 2 4 5

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x472
x86
x85

asked: Jan 26 '10 at 04:11 AM

Seen: 2006 times

Last Updated: Jan 26 '10 at 10:53 AM