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 2005 Forums
 SSIS and Import/Export (2005)
 Import XML data into sql 2005 dynamically

Author  Topic 

kondap
Starting Member

6 Posts

Posted - 2009-01-19 : 13:41:05
Hi

I am using sql server 2005 with Windows XP. I have a question on how to load xml data into sql server by applying business logic dynamically.

Question: The input is XML file which will have 5000 records. Before loading data into sql server destination tables , I have to apply business logic (2-3 level). what is the best way to achieve this?

Would it be feasible to write a stored proc with business logic and call this proc for each record in xml (5k), its a performance overhead I believe.

what is the best way to achieve this dynamically

I am assuming to follow below approach.

1. read the xml using SSIS and store in sql server staging table

2. read each record and pass it to stored proc (Stored proc will check for the business logic and inserts into multiple tables by checking referential integrity based on the logic).

Appreciate your help

Thanks

PK

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-01-19 : 19:54:16
mt 2 cents worth ..it will definitely be overhead to do it one record at a time.
why not dump it all out into a staging table then proceed from that table...
or apply the business logic on the fly...while dumping into a staging table.

?
Go to Top of Page
   

- Advertisement -