dbTalk Databases Forums  

Loading Several large text-files using batch and dts fails

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Loading Several large text-files using batch and dts fails in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
martensnl (Offline)
Junior Member
 
Posts: 1
Join Date: Apr 2006

Exclamation 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"

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.