File rename

  • Hi,

    I have a table within a database that contains two columns DocumentID and DocumentName.

    I also have a directory full of pdf files that are named DocumentName.pdf, these files are added to daily with new files, all with the same naming convention.

    I would like to run a job daily that would rename files from DocumentName.pdf to DocumentID.pdf

    Can anybody put me on the right track, I'm at a bit of a loss how to do it.

    Any help greatly appreciated.

    Cheers

    Rich

  • Look into SSIS and the File System Task or using a Script Task. You can select the records you want to loop through in a SQL task, put them into a recordset and use the built in SSIS For Each Loop to loop through them with the rename task inside that loop. IIRC, you'll want to google SSIS and "shredding a recordset" to come up with some good tutorials.

  • SSIS file system task looks like the go, thanks very much

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

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