﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / SQL Server 2005 Integration Services  / Use Database table to dynamically get the excel filename / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 09:59:22 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Use Database table to dynamically get the excel filename</title><link>http://www.sqlservercentral.com/Forums/Topic566867-148-1.aspx</link><description>I just gave up and used the normal file load</description><pubDate>Fri, 12 Sep 2008 15:34:48 GMT</pubDate><dc:creator>RC-874851</dc:creator></item><item><title>RE: Use Database table to dynamically get the excel filename</title><link>http://www.sqlservercentral.com/Forums/Topic566867-148-1.aspx</link><description>Reading on in the help about the exec sql task it says if you bring back more than one row you must define a variable of type object , then use script to extract the data. I'm now confused on how the orginal suggestion in his post could work.Any help appreciated.Thanks</description><pubDate>Fri, 12 Sep 2008 13:51:05 GMT</pubDate><dc:creator>RC-874851</dc:creator></item><item><title>RE: Use Database table to dynamically get the excel filename</title><link>http://www.sqlservercentral.com/Forums/Topic566867-148-1.aspx</link><description>Thanks for the help so far but the for each does not seem to make sense. Once I make the setting foreach file, it now reads each file in the directory. I want it to get the filename from the database select which brings back more than one row.Richard</description><pubDate>Fri, 12 Sep 2008 10:11:05 GMT</pubDate><dc:creator>RC-874851</dc:creator></item><item><title>RE: Use Database table to dynamically get the excel filename</title><link>http://www.sqlservercentral.com/Forums/Topic566867-148-1.aspx</link><description>Excel connection has the ExcelFilePath that you can set dynamically. (Edited by previous answer too).Use the File Enumerator in ForEach loop.</description><pubDate>Wed, 10 Sep 2008 15:45:54 GMT</pubDate><dc:creator>Mukti</dc:creator></item><item><title>RE: Use Database table to dynamically get the excel filename</title><link>http://www.sqlservercentral.com/Forums/Topic566867-148-1.aspx</link><description>what enumerator type did you use in the foreach loop</description><pubDate>Wed, 10 Sep 2008 14:52:36 GMT</pubDate><dc:creator>RC-874851</dc:creator></item><item><title>RE: Use Database table to dynamically get the excel filename</title><link>http://www.sqlservercentral.com/Forums/Topic566867-148-1.aspx</link><description>The way that I've done this successfully in the past was  to use the expressions to replace the Excel Filename property with the filename from some variable.My observation has been that the connection string property for a spreadsheet does not ever contain a filename, even when using a static filename. (but that is not to say that SSIS does not add the filename property to the connection string at runtime to produce it. At least that how i've done it in a ForEach container and it has always worked. Never had to do anything with the connect string property, only the filename property.</description><pubDate>Wed, 10 Sep 2008 12:42:43 GMT</pubDate><dc:creator>jmuldoon</dc:creator></item><item><title>RE: Use Database table to dynamically get the excel filename</title><link>http://www.sqlservercentral.com/Forums/Topic566867-148-1.aspx</link><description>Use expression to set the connection string for your excel connection. Use a variable to set the conection string. You can do this by Properties-&amp;gt;Expressions-&amp;gt;ExcelFilePath-&amp;gt; Set your vairble here.Now use Execute SQL Task to set the value of this variable. In the Execute SQL Task Editor, set the ResultSet as SingleRow, now click on Result Set on the side menu and click Add to add a vairble mapping. If you are uisng OLEDB conneciton use 0 as Resultset name and select your variable.This should set the variable to a value from your table and will set the Excel File Path for excel to this value.HTHMukti</description><pubDate>Wed, 10 Sep 2008 11:26:08 GMT</pubDate><dc:creator>Mukti</dc:creator></item><item><title>Use Database table to dynamically get the excel filename</title><link>http://www.sqlservercentral.com/Forums/Topic566867-148-1.aspx</link><description>I'm trying to build a package that loads a sheet from excel into SQL Server table. Each of our locations submits a file to the network. However some locations will go away and others may be added so I wanted to make the filename list table driven. I have the data flow working that successfully loads the spreadsheet but now I'm looking for a method to get the excel filename from a table. I was testing with the execute sql .Thanks for any helpRichard</description><pubDate>Wed, 10 Sep 2008 07:25:32 GMT</pubDate><dc:creator>RC-874851</dc:creator></item></channel></rss>