Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Loading Key Figures From Flat File

Author  Topic 

BWIN
Starting Member

1 Post

Posted - 2009-07-30 : 07:44:50
Hello, SQLTeam.com
1. I've created the Table TDOC1:

DOC_ID CALDAY AMOUNT CURRENCY LOC.AMT.RUB
-----------------------------------------------

Where:
DOC_ID = Varchar(6) [Contract ID]
AMOUNT = Money [ AMOUNT in CURRENCY]
CURRENCY = Char(3) [CURRENCY ID]
LOC.AMT.RUB = Money [Premium Amount in Local Currency [Russian Rubles] ]
CALDAY = Calendar Day.

FLAT FILE structure:
DOC_ID;CALDAY;AMOUNT;CURRENCY;LOC.AMT.RUB
DOC_1;20090730;100;USD;3000
DOC_2;20090730;200.50;EUR;7000
DOC_3;20090730;300.99;RUB;3000


2. BIDS
Flat File Connection Manager Editor Settings:
DOC_ID = DATA TYPE = string[DT_STR]
CALDAY = DATA TYPE = database date [DT_DBDATE]
AMOUNT = DATA TYPE = CURRENCY [DT_CY]
CURRENCY DATA TYPE = string[DT_STR]
LOC.AMT.RUB DATA TYPE = CURRENCY [DT_CY]


3. There are errors when I'm trying to load data into the Table TDOC1.
Suppose the main reason of errors are fields: "AMOUNT" and "CURRENCY".

QUESTIONS:
1.How can I define the field LOC.AMT.RUB always comes from flat file in RUssian Rubles.
And Key Figure AMOUNT in CURRENCY?

Report Structure:
CALDAY = 30.07.2009

DOC_ID CALDAY AMOUNT CURRENCY LOC.AMT.RUB
DOC_1 $ 100,00 USD 3 000 RUB
DOC_2 200,50 EUR EUR 7 000 RUB
DOC_3 300,99 RUB RUB 3 000 RUB

MS SQL SERVER 2008.


yavvie
Starting Member

46 Posts

Posted - 2009-08-03 : 05:26:20
Just to check:
you have two fields - Amount and Currency, and in BOTH you have the currency identificator? It seems so in your example, in which case you need to clean the field Amount from any text values to have only numbers left, and don't import that into [DT_CY] but use normal data types. In the package [DT_NUMERIC] and in the table something like Decimal (14,4) or (14,2) which works much better :)
Go to Top of Page
   

- Advertisement -