dbTalk Databases Forums  

Help Needed to create Update DTS

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


Discuss Help Needed to create Update DTS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Peter Newman
 
Posts: n/a

Default Help Needed to create Update DTS - 03-03-2004 , 07:11 AM






I have a Table ( BHYearHeaders) which i need to update on a regular basis from a csv file

the BHYearHeader stores header records of transactions from our client and the csv file updates the header records with a voloume number

Table
Licence varchar(6)
Serial varchar(6)
Volume varchar(6)
Trans Int
TransVal Varchar(11)

File

Licence, serial, volume, trans, transvalue

can anybody suggest ( in simple terms ) what is the best way to create a dts so that when it is run the BHYearHeader.BureauVolume is updated with the File.Volume when
BHYearHeader.Licence = File.Licence
&
BHYearHeader.Serial = File.Serial
&
BHYearHeader.Trans = File.trans
&
BHYearHeader.TransVal = File.transval


I was looking at using a textfile DataSource, but couldnt work out how to update the correct records as there are usually over 10,000 recorsd in the csv file

Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Help Needed to create Update DTS - 03-03-2004 , 07:22 AM






You could use a Data Driven Query task, and two sources, 1 text and 1 SQL.
The DDQ update query would look something like this-
UPDATE BHYearHeaders
SET BureauVolume = ?
WHERE Licence = ?
AND Serial = ?
AND Trans = ?
AND TransVal = ?

The question marks are placeholders for the parameters passed to the
"source" in the script transform.

Have a good read of the Books Online topics surrounding the DDQ as this is a
very short and incomplete description of what is required.


--
Darren Green
http://www.sqldts.com

"Peter Newman" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have a Table ( BHYearHeaders) which i need to update on a regular basis
from a csv file

the BHYearHeader stores header records of transactions from our client and
the csv file updates the header records with a voloume number

Table
Licence varchar(6)
Serial varchar(6)
Volume varchar(6)
Trans Int
TransVal Varchar(11)

File

Licence, serial, volume, trans, transvalue

can anybody suggest ( in simple terms ) what is the best way to create a
dts so that when it is run the BHYearHeader.BureauVolume is updated with the
File.Volume when
Quote:
BHYearHeader.Licence = File.Licence
&
BHYearHeader.Serial = File.Serial
&
BHYearHeader.Trans = File.trans
&
BHYearHeader.TransVal = File.transval


I was looking at using a textfile DataSource, but couldnt work out how to
update the correct records as there are usually over 10,000 recorsd in the
csv file




Reply With Quote
  #3  
Old   
Peter Newman
 
Posts: n/a

Default Re: Help Needed to create Update DTS - 03-03-2004 , 08:21 AM



Darren

I'm not getting very far with this as i dont understand the machanics.

is there any info giving a step by step example ?

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.