Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Server Agent Job - DTSRun Syntax Error Expand / Collapse
Author
Message
Posted Friday, August 8, 2008 8:27 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, November 19, 2014 2:47 PM
Points: 2, Visits: 10
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.



Post #549682
Posted Sunday, August 10, 2008 5:18 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 3:05 PM
Points: 31,284, Visits: 15,750
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
Post #549938
Posted Sunday, August 10, 2008 9:13 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, November 19, 2014 2:47 PM
Points: 2, Visits: 10
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.


Post #549967
Posted Tuesday, September 2, 2008 12:36 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: 2 days ago @ 6:52 AM
Points: 271, Visits: 315
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.



Post #562577
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse