Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help w/ xp_cmdshell

Status
Not open for further replies.

katbear

Programmer
Mar 14, 2007
270
US
Hi,

When attempting to run this command from Mgmt Studio:

exec master..xp_cmdshell "DTExec /FILE D:\CashRec mySSISpkg.dtsx"

I get this error:
Microsoft (R) SQL Server Execute Package Utility
Version 9.00.1399.06 for 32-bit
Copyright (C) Microsoft Corp 1984-2005. All rights reserved.
NULL
Option "-" is not valid.
NULL

I think the problem is that you need to call DTExec this way:

DTExec /FILE "D:\CashRec mySSISpkg.dtsx" (path in quotes)

but this doesn't work either:
exec master..xp_cmdshell "DTExec /FILE "D:\mySSISpkg.dtsx""

Help!

Thanks
 
I mean the command is:

exec master..xp_cmdshell "DTExec /FILE "D:\mySSISpkg.dtsx""

or

exec master..xp_cmdshell "DTExec /FILE D:\mySSISpkg.dtsx"


 
You should be running it like this.
Code:
exec master..xp_cmdshell 'DTExec /FILE "D:\CashRec mySSISpkg.dtsx"'

Note the single quotes around the command, and the double quotes around the file name.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top