all groups > sql server dts > september 2006 >
You're in the

sql server dts

group:

SSIS SQL Task Dynamic File Source


SSIS SQL Task Dynamic File Source Marty
9/28/2006 12:05:52 PM
sql server dts:
Greetings.

I have a folder containing a number of .sql files that I would like to
execute using Exec SQL task I'm looking for a way to dynamically set
the Exec SQL Task's FileConnection property using a ForEachLoop
container for the folder. Probably going to bring the path to the
folder in with a XML Configurtion File. Also trying to dynamically
configure the ForEachLoop container's Enumerator Configuration Folder
property.


Thanks!
RE: SSIS SQL Task Dynamic File Source Charles Kangai
9/28/2006 1:22:02 PM
Your example is very similar to the Books Online SSIS tutorial example. The
only difference is that while the tutorial examples loops through a list of
files for import, you are looping through the files to execute the SQL
scripts in them.

You will need to place your Execute SQL Task inside a Foreach Loop
container. Configure the Foreach Loop container to store the current
iteration file in a variable. The Execute SQL task has a property called
SQLSourceType; you will need to set this to File connection, then create a
connection manager that points to one of your files. You then want to set the
ConnectionString property of the file connection to point to the variable you
set in the Foreach Loop container. Done!

Work through the tutorial - it takes a very short time to go through and you
will see how to perform the steps I outlined above.

Charles Kangai, MCT, MCDBA
Author of Learning Tree's 4-day course: "SQL Server 2005 Integration
Services" http://www.learningtree.com/courses/134.htm
Author of Learning Tree's 4-day course: "SQL Server Reporting Services"
http://www.learningtree.com/courses/523.htm
email alias: charles
email domain: kangai.demon.co.uk


[quoted text, click to view]
Re: SSIS SQL Task Dynamic File Source Marty
10/3/2006 8:03:31 AM
Thanks Charles, it worked very nicely.


[quoted text, click to view]
Re: SSIS SQL Task Dynamic File Source tgr11
10/6/2006 12:25:49 PM
I am trying to do this also:

I get the following error:

"User::VarFileName" specified in the connection was not valid.

When I try to put user::varfilename in the ConnectionString Field.

I set DelayValidation to true.
Re: SSIS SQL Task Dynamic File Source tgr11
10/6/2006 12:49:20 PM
Sorry; I figured it out.

syntax is @[User::VarFileName]
Re: SSIS SQL Task Dynamic File Source Charles Kangai
10/6/2006 12:59:01 PM
Use either @[User::VarFileName] or @VarFileName.

Note that the names are case-sensitive.


Charles Kangai, MCT, MCDBA
Author of Learning Tree's 4-day course: "SQL Server 2005 Integration
Services" http://www.learningtree.com/courses/134.htm
Author of Learning Tree's 4-day course: "SQL Server Reporting Services"
http://www.learningtree.com/courses/523.htm
email: charles at kangai.demon.co.uk



[quoted text, click to view]
AddThis Social Bookmark Button