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.
Author |
Topic |
LearningSQLKid
Yak Posting Veteran
51 Posts |
Posted - 2012-11-14 : 20:28:17
|
Hi GuysI need your help in desigining an ETL package Using SSIS. I need to find out an efficient way of doing the following1- I have Excel file contains list of tables along with source and destination server and databse names which should be loaded to database Fo instanceSrNo TableName SRCServer SRCDB DESServer DesDB---------------------------------------------------1 Table_1 Svr_1 DB_1 Srv_2 DB_22 Table_2 Svr_1 DB_1 Srv_2 DB_23 Table_3 Svr_1 DB_1 Srv_2 DB_22- I need to pick each table from the file one by one to load data into table (to destination)3- Table names in source and destination are the sameAny idea, how would i dynmically do it ?Appreciate help and quick replyThanksSelect Knowledge from LearningProcess |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-11-15 : 10:35:54
|
yepCreate a variable of type object in SSIS packageAdd a data flow task with Excel Source to point to Excel file and ADO Recordset destination to point to object variable.Then use a For Each Loop to loop through ADO .NET recordset and then use individual variable to hold servername,dbname etc. If tables are all the same structure then you can use same data flow for data transfer else you need to use separate data flow one for each table.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
LearningSQLKid
Yak Posting Veteran
51 Posts |
Posted - 2012-11-15 : 16:13:37
|
quote: Originally posted by visakh16 yepCreate a variable of type object in SSIS packageAdd a data flow task with Excel Source to point to Excel file and ADO Recordset destination to point to object variable.Then use a For Each Loop to loop through ADO .NET recordset and then use individual variable to hold servername,dbname etc. If tables are all the same structure then you can use same data flow for data transfer else you need to use separate data flow one for each table.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/Hi VisakThanks for you reply.Is it possible to make this overall process a dynamic process. For instance if i update Excel file with new tables and then i would have to add a new data flow task to the solution (not so much of work), any thoughts around making it dynamic so that the support gusy update the file and let the SSIS package do the rest ?Thanks Heaps
Select Knowledge from LearningProcess |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-11-15 : 22:24:57
|
quote: Originally posted by LearningSQLKid
quote: Originally posted by visakh16 yepCreate a variable of type object in SSIS packageAdd a data flow task with Excel Source to point to Excel file and ADO Recordset destination to point to object variable.Then use a For Each Loop to loop through ADO .NET recordset and then use individual variable to hold servername,dbname etc. If tables are all the same structure then you can use same data flow for data transfer else you need to use separate data flow one for each table.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/Hi VisakThanks for you reply.Is it possible to make this overall process a dynamic process. For instance if i update Excel file with new tables and then i would have to add a new data flow task to the solution (not so much of work), any thoughts around making it dynamic so that the support gusy update the file and let the SSIS package do the rest ?Thanks Heaps
Select Knowledge from LearningProcess
Its not a problem adding new rows to excel so far as the metadata (columns) does not change.But for actual data flow you've to have as many data flow paths as tables so long as tables have different structure.SSIS cant change metadata at runtime ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
LearningSQLKid
Yak Posting Veteran
51 Posts |
Posted - 2012-11-19 : 22:53:19
|
Thanks visakhIf Dat flow task could have changed the meta data dynamically , it would have made SSIS more strong.Thanks for you help my friend :)CheersSelect Knowledge from LearningProcess |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-11-20 : 02:51:27
|
quote: Originally posted by LearningSQLKid Thanks visakhIf Dat flow task could have changed the meta data dynamically , it would have made SSIS more strong.Thanks for you help my friend :)CheersSelect Knowledge from LearningProcess
Thats against the basic ETL assumption which assumes source to be fixed. Any changes that have to done has to be preset by means of transformations in data flow and it cant vary at runtime------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|