Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

2 questions on using variables and expressions

$
0
0

We have a SSIS package to export set of tables to CSV files in specified directory, we created 2 variables PATH and DATE and both of these variables are used to build an expression that is used to generate connection string for flat file connection manager. For example by default the values are set as following:

PATH=c:\temp\

DATE: We are using  EvaluateasExpression = True and Expression=Getdate() (idea is that if the user don’t change it during runtime then it will always default to current date)

Expressions, ConnectionString =@[User::Path]  + "_table_name_" + (DT_STR, 4, 65001)  YEAR( @[User::Date]  ) + "_" +  RIGHT("0" + (DT_STR, 2, 65001)  MONTH( @[User::Date]   ), 2)  + "_" +   RIGHT("0" + (DT_STR, 2, 65001)  DAY( @[User::Date]   ), 2) + ".csv"

and specify flat file connection manager ConnectionString=@ConnectionString, for example for today it evaluates to c:\temp\table_name_2012_09_18.csv

We are using XML package configuration and user can modify both of these variables along with SQL Server connection manager at run time. We have 2 questions:

We specified the default values during variable creation and when we run in debug mode(F5) it always uses the default value even if we modify the value in variable screen  and we confirmed it using breakpoint, Is there any way we can try different values to see if it works fine without deploying the package (it works if we deploy the package and then modify the package configuration file and then run it)

When we change the value of variables at run time then PATH is taking new value but DATE always retain default value (i.e. GETDATE()) even if we modify it is config file,  Is the problem is that expression is set to Getdate() and it can’t be changed at run time or what can be the possible issue and how to resolve it?


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>