SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Question on filtering data in SSIS
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

itmasterw
Yak Posting Veteran

90 Posts

Posted - 03/06/2013 :  08:09:03  Show Profile  Reply with Quote
Hi,
I am very new to SSIS and trying to learn how to use it, but I formally did do DTS packages. In Dts we would often bring in a text or Excel file and put it into a temporary table. From here we would run sql statements (in a sql component) to filter out cretin things that we wanted.
For example, if we had a file that had First name, Last name, address, City, State, and zip code, we could say give me only the records with zip code 15246. This set would then be sent to a permanent table.
I am able to bring in the file and move the data to the tabel, but I cannot see to apply SQL to filter.
How can I do this in SSIS?

Also, do you have any suggestions as to where, on line, I can go to learn SSIS?

Thank you


ITM

Edited by - itmasterw on 03/06/2013 08:11:17

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 03/06/2013 :  11:45:10  Show Profile  Reply with Quote
you can specify the filter by using conditional task inside data flow task

Add excel source to point to your excel file (or flat file in case of text file), add a conditional task in between to do filtering. Then place a OLEDB destination for inserting data to your table

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

itmasterw
Yak Posting Veteran

90 Posts

Posted - 03/06/2013 :  12:25:32  Show Profile  Reply with Quote
Thanks for your help, but I do not see where you would put a SQL statement to create a filter here.

Thank you

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/


[/quote]

ITM
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 03/06/2013 :  12:30:54  Show Profile  Reply with Quote
no sql statement for filter. the expression will be written inside conditional task where you'll have all the fields from the source file available. There you can define an output and write an expression like

ZipCode == 15246

then join this output path to OLEDB destination where you populate the table

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

itmasterw
Yak Posting Veteran

90 Posts

Posted - 03/07/2013 :  07:51:26  Show Profile  Reply with Quote
Well this woudl help but isn't there a way to write sql for really advance filtering? Inthe old DTS packages I was able to write really advance sql statements to query a table; like even using things like CTEs in them. I would be able to use even sql functions like date and string fuctions in Sql statements. There must be a way of ding thei here?

Thank you

ITM
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 03/07/2013 :  09:06:28  Show Profile  Reply with Quote
then you've to do it execute sql task in control flow. SSIS has two engines one for control flow and another for data flow as against common engine in dts

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000