Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Copy doc, rename (prefix) it with identity value and insert into SQL tables

$
0
0

I am trying to copy documents from one network drive to another. The challenges I have are:

  1. 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).  
  2. 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-



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>