dbTalk Databases Forums  

Check DataType before import in SSIS

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


Discuss Check DataType before import in SSIS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
msnews.microsoft.com
 
Posts: n/a

Default Check DataType before import in SSIS - 01-18-2006 , 09:49 PM






Hi,

I have to import data from a hand made Excel file into a data base. The
excel file is build by an other department of my company. As this process
needs to be done many times, I build a SSIS package for it.
My problem is the following: as the Excel file is build manually, Typos can
happen easily. Thus, I need to check the data type first before being able
to just import it in the Database. A date must be a date with a proper
format that the DB can understand and store, a char(30) must be a string
not exceeding 30 characters and so on... Is there anyone who knows what's
the best approach in SSIS to check data type before importing the data in a
DB table? I have no idea if there is a pre-defined task for that... Or if I
should write some custome (C#?) code for that (if so, how?)

Best regards and thanks in advance.

Francois Malgreve



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Check DataType before import in SSIS - 01-19-2006 , 12:32 AM






Hello msnews.microsoft.com,

Ok there are a number of ways to attack this and depending on your actual
requirements they may differ. One solution would be to use a conditional
split transform. In there test the length of the column and if it meets
your criteria you pipe the row one way else you pipe it a different way downstream.
Another way is to use a Script transform. Once inside here with your VB.Net
code you can pretty much do whatever you want.


Thanks

Allan


Quote:
Hi,

I have to import data from a hand made Excel file into a data base.
The
excel file is build by an other department of my company. As this
process
needs to be done many times, I build a SSIS package for it.
My problem is the following: as the Excel file is build manually,
Typos can
happen easily. Thus, I need to check the data type first before being
able
to just import it in the Database. A date must be a date with a proper
format that the DB can understand and store, a char(30) must be a
string
not exceeding 30 characters and so on... Is there anyone who knows
what's
the best approach in SSIS to check data type before importing the data
in a
DB table? I have no idea if there is a pre-defined task for that... Or
if I
should write some custome (C#?) code for that (if so, how?)
Best regards and thanks in advance.

Francois Malgreve




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.