SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Server Agent Job - DTSRun Syntax Error


SQL Server Agent Job - DTSRun Syntax Error

Author
Message
Don Sharp
Don Sharp
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 18
I am trying to create a SQL Server Agent job to run a DTS package, but the job fails with an " Invalid command options" error. The job has only one step of type Operating System Command (CmdExec). The command I have entered is:


DTSRun /~N TEST_Import_SettlementExposures

where TEST_Import_SettlementExposures is the name of the DTS package. If I go to the DTS package and schedule it from there, the scheduled job runs fine, but the DTSRun command references the GUID of the DTS package. I will be moving this DTS package and job to another computer, so I can't just script the scheduled job as the GUID will be different on the new machine.

What is the proper syntax for the DTSRun command in the job step command window?

I am sure it is something stupid that I am overlooking, but I just can't see it.

I greatly appreciate any help with this.



Steve Jones
Steve Jones
SSC Guru
SSC Guru (142K reputation)SSC Guru (142K reputation)SSC Guru (142K reputation)SSC Guru (142K reputation)SSC Guru (142K reputation)SSC Guru (142K reputation)SSC Guru (142K reputation)SSC Guru (142K reputation)

Group: Administrators
Points: 142576 Visits: 19424
I think you need to reference the server as well. DTSRun needs to know where the package is. Is it in the file system? In msdb?

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Don Sharp
Don Sharp
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 18
It is in msdb (I'm assuming). It shows up under Data Transformation Services / Local Packages on the same server as the SQL Server Agent job.



pnewhart
pnewhart
Old Hand
Old Hand (369 reputation)Old Hand (369 reputation)Old Hand (369 reputation)Old Hand (369 reputation)Old Hand (369 reputation)Old Hand (369 reputation)Old Hand (369 reputation)Old Hand (369 reputation)

Group: General Forum Members
Points: 369 Visits: 386
I was just trying to figure this out and I came across your post. Here's the solution that worked for me:

DTSRun /S"Server" /N"Package Name" /E

The tilde (~) is a switch that tells SQL Server to expect the information to be encrypted, so you don't need that in your case. When you right-click a package in SQL 2000 and select schedule, SQL Server defaults to creating the command string as encrypted. However, if your package doesn't have a password in the job, then I don't see a need for using encryption in the job step. Also, the /E specifies a trusted connection.



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search