Whitespace is not allowed at this location

I am trying to run a SSIS package from a job in SQL Server 2005. The package is importing a flat file into the database and works fine when run from SSIS. When I try to run it as a job I get the error that points to the location of an ampersand. I just finished creating two other jobs doing virtually the same thing and have not had any issues.

Any suggestions on why this is occurring are greatly appreciated.

Scott

can you post the error message and the data it is complaining about?

In the job history the following message is being logged:

Unable to load the package as XML because of package does not have a valid XML format. A Specific XML parse error will be posted. Description failed to load XML package from "filepath" due to error 0x00CE513 "Whitespace is not allowed at this location Line 2, column 179". This happens when loading a package and the file cannot be opened or loaded correctly into an XML document. This can be the result of either providing an incorrect file name to the LoadPackage method or the XML file specified having an incorrect f. The step failed.

In the source xml, what is at line 2, column 179? Is it a single ampersand? If so, you'll need to escape it with &

That's the thing. I cant do that and I just created 2 other jobs that work with the same column that has many values that include an ampersand. The reason I cannot do it is this is a file that is generated by a vendor/partner every day and saved on our network. The job is going to be scheduled to look for that file and run it.

Any other possible causes anyone can think of for this problem.

You're going to have to add a step to the job to preprocess the xml and apply escape sequences as necessary

Any thoughts as to why this is not necessary when running from SSIS? Why would running it as a job cause this issue?

Running the package from a job? Same input? Are you certain the same connection manager is used when you run it on the server vs your desktop? (This I have seen before!)

I am running the package from a job and I am using the same connection.

This raises other questions. I first created my package and then was going to just schedule it as a job. As it turns out though I have to develop a user interface so someone can actually start the process. So I created a stored procedure and built the user interface in Access2010. This works fine for two other processes. I am wondering though if I should be calling the package directly from the stored procedure. It may help with this issue and the next process I have to do requires a filename to be passed from access to the package. I am not sure if I can even do that with a job run from a stored procedure.

you can set parameters to pass to a package. It's what SQL Agent does when you specify Values