SSIS: How to set XML Task, XML Location and XSD Location properties dynamically

Hi All

In SSIS 2008 I have an XML task that accepts hard-written path-files for XML Location and XSD Location.
Question:  Does anyone know how I can set these to either a variable, or a connnection in Connection Manager?

Thanks in advance.
Jim
LVL 66
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAsked:
Who is Participating?
 
lundnakCommented:
I understand what you are trying to do.  I suppose it might be possible to use to an ActiveX or VB Script task to change the XSD property on the XML Source.  However, I think what you want to do is likely impossible.  Switching out the XSD file at run time is going to be difficult.  I assume that SSIS uses the the XSD file to build the metadata for the XML source.
0
 
lundnakCommented:
You should be able to using Expressions in the properties window for the XML task or File Conneciton manager.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
There is no expressions section in the XML task editor, or advanced editor, that I can see.
I also don't see any way to set it to a connection.

Editor - XML Location and XSD Location only accept text.
            *** I just noticed that if you set Data Access mode to 'XML file from variable' it allows you to set a variable name, but there is no similar functionality for the Schema file.
Advanced Editor - Component Properties tab, XMLData and XML SchemaDefinition properties only accept text.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
lundnakCommented:
Expressions should be setup in Properties window.  Select the XML Task and pres F4.  Does this help?
0
 
Alpesh PatelAssistant ConsultantCommented:
You can do it using Expression.
Capture.PNG
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
I'm using an XML Source in my data flow (image attached), not an XML Task which only appears in the control flow.
I have my XML Source as the source for about 30 different pumps in the Data Flow task, so I do not wish to change this if I can help it.
The XML Source does not have an Expressions page per the screen shot above.


ssis-xml-task-source-editor.jpg
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
Here's the advanced editor (image attachged)
In nether view is there an Expressions page.
ssis-xml-task-source-advanced-ed.jpg
0
 
lundnakCommented:
I have included two screen shots that display the expressions property for the XML Source Connection Manager. XML Source
0
 
lundnakCommented:
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
My need isn't to set an XML Connection.   It's to set an XML Task (see above screen shots) to that connection for the XML file, and somehow (connection/variable/?) to the related XSD file.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
Project is near complete, and dynamic connections was not a priority, so I did not pursue this.

Since it was not in the UI, I'm going to accept lundnak's comment that it likely cannot be done.

Thanks.
Jim
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
Figured it out durring warranty time.

Per http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/74f83272-67ec-48fe-923b-e520dec9f700/
       Properties that support expressions do so by appearing at the (Data Flow) task level..., meaning NOT at the XML Source Task level.

So, I clicked on the Data Flow Task (not the XML Source Task within the data flow), Properties window, Expressions..., and [My XML Source Task].[XML Schema Definition] was available to be set to a variable.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.