Thursday, March 22, 2012

"XML Source" xsd relative path

Hi all,

Is it possible in the XML Source to specify a relative path for the xsd file? If not, do you have any idea why?

Best regards,
pcSSIS doesn't support relative paths anywhere that I'm aware of. As to why, there is no assumption that a package will ever exist in the filesystem and thus have a root path from which to base a relative part. Packages can be created programmatically and executed, or stored in SQL Server.

There are a couple techniques to build fake relative paths from dynamically defined roots such as the USERPROFILE environment variable that have been discussed in other threads.

|||Hi JayH,

If the package is executed in the SQL Server where should the xsd file be stored? I have a Web Service Task for extracting data from a Web service . It writes the web service output in a xml file and after that this xml file is used as a source for a XML Source. Finally the data from the web service is inserted in a SQL Server database. Where in the database then, not in the file system, should I store the xml file and the xsd for it? And actually this relative path question came out because the SSIS packages we develop are under source control and if they do not support relative paths it is very difficult for two people to work on the same package under source control.

Best regards,
pc|||

pc_83 wrote:

Hi JayH,

If the package is executed in the SQL Server where should the xsd file be stored? I have a Web Service Task for extracting data from a Web service . It writes the web service output in a xml file and after that this xml file is used as a source for a XML Source. Finally the data from the web service is inserted in a SQL Server database. Where in the database then, not in the file system, should I store the xml file and the xsd for it? And actually this relative path question came out because the SSIS packages we develop are under source control and if they do not support relative paths it is very difficult for two people to work on the same package under source control.

Best regards,
pc

Not sure I understand your question, but I think your only options are to have the XSD on the disk or inside the XML. The XML can either be a file or a variable. You could read the XSD from the database and insert that into the XML you get from the web service if you want to avoid the disk.

I understand the Source Control scenario very well. In my case, we decided that all package paths would be relative to each user's profile. Each developer was required make their working folder the same location under "My Documents". This was also handy since multiple users could log into the big development server and work on the same solution without interfering with each other's child packages, raw files, etc. All paths were constructed dynamically at run-time using expression-based variables and the USERPROFILE environment variable that was read with a package configuration.

|||Thank you for the detailed answer. I thought it would be easiest, bit obviously I do not have much choice.

Best regards,
pc

No comments:

Post a Comment