SSIS multiline string variables , in VS 2008

1.3k Views Asked by At

I need to store a large query into a string variable.

When I paste the sql query into the Value property of the variable, I see only one line. I am using VS 2008 , BIDS to design the package. I think this is a bug as stated here,

what I am actualy intersted is a workaround to bypass this.

2

There are 2 best solutions below

2
On BEST ANSWER

We use a parameters table in a SQL database, then load long strings into variables using a simple SQL query. This has the additional advantage that you can refactor the query code without opening SSIS.

It also allows multiple packages to easily share common query code.

Edit: Of course, if you only want to do this once...

Manually edit the XML. Put a placeholder value in the variable, then open the .dtsx in a text editor, locate the placeholder value, and replace it with the value you need.

Please back up your package prior to doing this.

2
On

Another work around - you can set the EvaluateAsExpression to True and put the SQL query in the Expression. The Expression will have a ... button which you can click to edit a multi-line value.