SSIS package with different queryies
Hi i have created ssis package, based on some condition i need to execute different type of queries . Is it possible using SSIS. Or do i need to maintain separate SSIS packages(with specific query) for each specific condition.
June 1st, 2012 1:33am

You can use script task to handle different type of queries. You can create variables and in the script task write variables as per your requirement and then use the variables as the source query in your task. Let me know if you have any question. Thanks, Saikat
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2012 1:48am

thanks Saikat. Do u have any sample code/tutorial for the same
June 1st, 2012 1:58am

What exactly do you mean with "different type of queries"? Can you give some examples? How more specific you are, how easier it is for us to help you.MCTS, MCITP - Please mark posts as answered where appropriate.
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2012 2:25am

What is your exact requirement? what are your input and desired output? Thanks, Saikat
June 1st, 2012 2:34am

i have input flat input files say inputfile1.txt ( which will have many columns with data). Inputfile1.txt will have one specefic year data. example year subject grade marks below25% etc.. 2011 MAths 1 55 1 2011 Science 2 66 0 ....... i need to read above mentioned input type file and insert into sql server table1. Condition: inputfile1.txt has column called "year" , if "year" ==2012 , then i need to take 8 columns with data from inputfile1. txt and insert into table1. if year>20212, then i need to take 5 columns and with data from inputfile1.txt and insert into table1 also while inserting inerting into table1 i need to delete existing all records of that year and insert the freshdata from inputfile1.txt pls let me know
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2012 3:31am

Here're figures I copy from my examples... ignore the descriptions of components. You can load this flat file and use a Conditional Split Transformation to set some conditions. If year == 2012, then we have an output, if year > 2012, then we have another output. Different output have different processing way.. Hope it helps! Vote if it's helpful! Simon MSN:simonlv@live.cn Skype:simonlvpin
June 1st, 2012 3:48am

Here're figures I copy from my examples... ignore the descriptions of components. You can load this flat file and use a Conditional Split Transformation to set some conditions. If year == 2012, then we have an output, if year > 2012, then we have another output. Different output have different processing way.. Hope it helps! Vote if it's helpful! Simon MSN:simonlv@live.cn Skype:simonlvpin
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2012 3:52am

Steps to follow: 1. Extract the data from your input1.txt and store in any temp table. This table will be always truncated at the beginning of your package run. 2. create one Stored Procedure and call that using SQL Task. In that Stored procedure you can write your business logic to insert rows in table1. Check first the Year from the Temp table. Use If ELSE block in the query to insert rows in the table. Let me know if you have any questions. Thanks, Saikat
June 1st, 2012 3:52am

Sure, there're many ways to proces this, you could use SSIS component or stored procedure.Hope it helps! Vote if it's helpful! Simon MSN:simonlv@live.cn Skype:simonlvpin
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2012 4:22am

Sure, there're many ways to proces this, you could use SSIS component or stored procedure.Hope it helps! Vote if it's helpful! Simon MSN:simonlv@live.cn Skype:simonlvpin
June 1st, 2012 4:26am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics