Copying and Moving Windows Directory Files using SQL Server 2008
Posted on 2014-01-26
I have a folder with about 500,000 files (pdf, tiff,etc...,).
I ran a script in SQL Server 2008 that listed all of the files names from the folder in a SQL Server database using XP_CMDSHELL.
What I want to do is, copy and then move the files to another location using the filenames that I have in another table on my server. Out of the 500,000 files only 120,000 will come over, but the file name of those files are in my database table.
Would like a solution using XP_CMDSHELL. I have been able to figure out how to move files from folder to folder, but not how to move files to another folder based on results from a sql server db.