x
login about faq Site discussion (meta-askssc)

SSIS XML Data Source and variables

I have a datasource that needs to be created using variables but the "XML File from Variable" doesn't recognise the source when using the variables. If you hard code the path in the variable it works OK.

All ideas gratefully received.

The hardcoded path that works is:

d:\DropBox\In\AA.XMLProcessing

alt text

If this isn't possible does anyone have any workarounds?

Many thanks

Variables.jpg (21.0 kB)
more ▼

asked Apr 12 '12 at 04:04 PM in Default

Mrs_Fatherjack gravatar image

Mrs_Fatherjack
4.6k 48 53 61

just a thought - variable scope is a pain in SSIS, are all the variable declared in the right places?

Apr 12 '12 at 04:07 PM Fatherjack ♦♦

All variables in the package scope so should be OK. I've been burnt by that before. :)

Apr 12 '12 at 04:10 PM Mrs_Fatherjack
(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

You actually will need to build this as an expression within the property window of the "XMLSource" variable. Your expression should look like:

@[user::SourceDir] + "\\" + @[User::FileName] + ".XMLProcessing"

Then ensure you have the EvalueAsExpression property set to true for your "XMLSource" variable.

more ▼

answered Apr 12 '12 at 04:40 PM

Shawn_Melton gravatar image

Shawn_Melton
4.7k 13 18 27

@Shawn Melton +1. This should do it. Although I have to edit your answer to show double backslashes (put 4 backslashes to make it work) :) The same way SSIS works ;)

Apr 13 '12 at 06:27 AM Usman Butt

Awesome, that works perfectly. Many thanks.

Apr 13 '12 at 07:35 AM Mrs_Fatherjack
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x758
x116
x1

asked: Apr 12 '12 at 04:04 PM

Seen: 1044 times

Last Updated: Apr 13 '12 at 07:35 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.