Specify Output Excel file name as a parameter

  • Hi all,

             I have a DTS package which exports data into an Excel file, with the source as the results from a SQL Server stored procedure, and the destination as an Excel file which already exists.

             Is it possible to run the package with a different Excel file name each time? For example, I want to use dtsrun command prompt utility but let the user specify an excel file name to be saved.

    Thanks a lot,

    delpiero

     

  • Create a global variable and assign it to the excel output filename.

    To do so, select Package/Properties/Global variables. type in a global variable.

    Add a dynamic Properties taask to the package. Looks like a puzzle.

    To assign, double click dynamic properties task/add/expand connections/Highlight the excel con/double click on datasource/dropdown arrow to global variable/dropdown to the variable you have created.

    Whenver you run the package supplying a value for the global variable, it will write to an excel file of that name.


    ------------------------------
    The Users are always right - when I'm not wrong!

  • Thanks Jonathan, Your method works fine.

    But is it possible to specify a network drive or UNC path for the excel file? I found that I always got an "failure to create file" error even I have set all the permissions and used UNC names.

    Thanks

    delpiero

     

  • If you are getting problems with the unc path, map a drive and use that instead.


    ------------------------------
    The Users are always right - when I'm not wrong!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply