Automatically move files from one folder to another - SQL Job

  • I am in need of a job step to move all files with a .dat extension to another folder.

    Source Folder: C:\Temp\Ack

    Destination Folder C:\Temp\Reports

    Files to move: *.dat

    I need to be able to call this from a SQL Job (SQL 2005). I attempted to use a File System Task to move the files, but it seems with this method, you need to specify file names. I thought of powershell, but due to this being SQL 2005 calling a power shell script from a SQL job is not feasible.

    Can anyone please recommend a method?

    Thanks!!!

  • A CMDEXEC job step should be able to run the command "MOVE C:\Temp\Ack\*.dat C:\Temp\Reports".

    If you want to use the File System Task in an SSIS package to move the files, put it in a ForEach File container. The container can look for the files and put the full name in a variable, then the File System Task can use that variable as the source file.

  • Thanks Scott!!! I just figured that out and came back here to reply that I have answered my own question.

    Thanks for the help!!

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

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