Loading Several large text-files using batch and dts fails -
04-13-2006
, 08:04 AM
I'm currently using dts for loading data into a table.
As the source for this data I use Text-files.
I use Globale variable to define the source.
When I load each file separatly everting is OK (one by one). But when I use the script below, I get errors that there is a violation of the primairy key.
I think that the variable are not change everytime when the dts is called
This is the scrip I use to load all the files: REM Type: Batch File
REM Import all flat files to SQL Server using DTS
REM Export DIR listing to C:\flat_file\Dirlist_B.txt
dir c:\flat_file\1350_KB*.tot /b > C:\flat_file\Dirlist_B.txt
REM Execute DTS package for every file name in the Dirlist_B.txt
for /f "tokens=1,2,3" %%i in (C:\flat_file\Dirlist_B.txt) do call "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\DTSrun.exe" -F "c:\flat_file\Record_b.dts" -A"FileName"="c:\flat_file\%%i" -L "c:\flat_file\1350_KB.log" |