Search code examples
sql-serversql-server-2012command-line-argumentsexit-codedtexec

DTExec.exe CheckFile and Validate fails


I'm trying to execute a dtsx script using DTExec.exe as part of the batch process. The following command line script works:

"C:\Program Files\Microsoft SQL Server\130\DTS\Binn\DTExec.exe" -File "\\\\vm-to-somewhere\d$\Projects\test.dtsx"

However, if I try to run a check/validation on the test.dtsx file before actually running the script, it fails with an exit code of 6 (which translates to: The utility encountered an internal error of syntactic or semantic errors in the command line).

$ "C:\Program Files\Microsoft SQL Server\130\DTS\Binn\DTExec.exe" -CheckFile "\\\\vm-to-somewhere\d$\Projects\test.dtsx"
$ "C:\Program Files\Microsoft SQL Server\130\DTS\Binn\DTExec.exe" -Validate "\\\\vm-to-somewhere\d$\Projects\test.dtsx"

Returns: Option "\\\\vm-to-somewhere\d$\Projects\test.dtsx" is not valid.

It's probably just a simple mistake I'm overlooking, and I was wondering if it was something with the backslashes but the first command runs fine so it doesn't make sense.

Also, if someone could point out to me the differences between -CheckFile and -Validate, that might help me decide which to use in my script. I just need to know if the dtsx works fine before executing it because it takes 3hrs to run and I prefer to find out sooner rather than later.

References: https://msdn.microsoft.com/en-us/library/hh231187(v=sql.110).aspx


Solution

  • You missed "-File" (or "-f") option just in front of your package name

    It should be like

    DTExec.exe -f "<package name with path>" -Validate
    

    Note that the package may have a configured delayed validation, so -Validate option won't validate the items with delayed validation. There are options to enforce a validation of items with delayed validation, but this is a separate topic.