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 67
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
lundnakCommented:
Expressions should be setup in Properties window.  Select the XML Task and pres F4.  Does this help?
0
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.