Darren Wood
Darren Wood

Reputation: 1528

File Source Connection Expression in SSIS for file in Bulk Insert Task Editor

Is there a way to do a expression for the Source Connection. I have entered in an expression under source connection and it is not working? Or could it be done in a script task? I want to have the folder part of the expression as a variable.I have Visual Studio 2008. I am getting the error.

Error at InsertIntoClientStaging: The connection "C:\Temp\Attributes.bin" is not found. 
This error is thrown by Connections collection when the specific connection element is not found.

In the XML I have this prpoerty.

BulkInsertTask:SourceConnectionName="C:\Temp\Attributes.bin" 

It seems if this thinks it is it's name and not it's path.

Upvotes: 0

Views: 352

Answers (2)

Darren Wood
Darren Wood

Reputation: 1528

The answer to my problem is to click on the File Connection and then select properties. Then click on the Expression's three dots. Then enter my expression for the connection string there for the file connection. Yes this is easy. Before hand I was not aware of the expression for the File Connection and was simply double clicking on the file connection and not getting the ability to enter an expression there. I was thus entering the expression in the source connection of the bulk insert.

Upvotes: 0

BIDeveloper
BIDeveloper

Reputation: 2638

Yes - Your source connection would point to a connection manager and then you would amend the "connection managers connection" via an expression e.g. different server name depending on whether you are in live or dev.

I personally try and avoid script tasks where possible for the simple reason that they are harder for the next developer to understand what is going on - without having to delve into the script.

Upvotes: 1

Related Questions