I am trying to copy documents from one network drive to another. The challenges I have are:
- While the documents are being copied to the destination folder, renaming/prefixing the documents at the destination folder with an identity value is becoming very complex for me. There are multiple existing documents at the destination folder and I am trying to avoid copying the docs first and renaming them later. The document name in the folder and SQL table has to be identical (1212_fileName.pdf).
- Each folder names must be parsed and inserted into two SQL Server tables and the folder names are underscore-delimited:My city is Suitland_My state is MD_This is the city I was born_Baltimore is not the city in which I was married_DOB 06-15-1999_I am done here\fileName.pdf. I have the script that parses the underscore-delimited. However, creating a variable to add the identity value to thedocument that will be copied and to insert the same identity + document name to a SQL Server table is becoming problematic.
I have managed to copy the files but inserting the identity value to sql server and prefixing the identity value to the doc
name is becoming a nightmare :-(. Here is a visual description of what I am trying to do:
Any suggestion or help is really appreciated.
Thank you in advance,
~In-