Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Location
    Maryland
    Posts
    17

    Unanswered: Can you set up a DTS package to accept a filename dynamically?

    First, let me say that I am a junior level SQL Server DBA. I haven't had to deal with creating DTS packages much at all.

    I am trying to allow a user to import data from an Excel file on a regular basis through an ASP web page. I have had no problem writing and using a stored procedure that calls the xp_cmdshell procedure to run dtsrun. But the DTS package looks for the same file/location everytime, and I can't figure out how not to give it a filename/location when I create the package. Unfortunately, the name of the Excel file that needs to be imported changes regularly.

    Basically what I would LOVE to know is if you can create a DTS package that can be called from the dtsrun utility and can accept a different filename every time. Any ideas? Or any alternate solutions?

    MUCH THANKS in advance,

    Bill
    Last edited by bill_doe; 08-13-03 at 17:16.

  2. #2
    Join Date
    Dec 2002
    Posts
    2

    Cool Re: Can you set up a DTS package to accept a filename dynamically?

    Originally posted by bill_doe
    First, let me say that I am a junior level SQL Server DBA. I haven't had to deal with creating DTS packages much at all.

    I am trying to allow a user to import data from an Excel file on a regular basis through an ASP web page. I have had no problem writing and using a stored procedure that calls the xp_cmdshell procedure to run dtsrun. But the DTS package looks for the same file/location everytime, and I can't figure out how not to give it a filename/location when I create the package. Unfortunately, the name of the Excel file that needs to be imported changes regularly.

    Basically what I would LOVE to know is if you can create a DTS package that can be called from the dtsrun utility and can accept a different filename every time. Any ideas? Or any alternate solutions?

    MUCH THANKS in advance,

    Bill
    Use ASPUpload or something to that affect to upload your Excel file to a certain location(This can be any directory as long as the IUSR_MachineName has rights to read and write to it). You can also use
    this dll to change the name to anything you would like.
    That way you can call your DTS package with the same name everytime and only have to change the name in the uploading of the file through ASP. You could also rename the previous file so you have a copy of it.

    Hope this helps!
    Tim

  3. #3
    Join Date
    Aug 2003
    Location
    Maryland
    Posts
    17

    Re: Can you set up a DTS package to accept a filename dynamically?

    I didn't even think about that. Great alternative Tim! Thanks so much!

    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •