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
 General SQL Server Forums
 Database Design and Application Architecture
 Importing from Xml to SQL in SSIS

Author  Topic 

sandesh.ravi
Posting Yak Master

110 Posts

Posted - 2011-09-12 : 11:45:37
Hi,
I am new to SSIS. I am importing the data from xml file to sql table. However i need to add the file path in the first column of the destination table and the current time in the last update column of the destination table.

Please provide me some inputs.

Thanks,
Sandesh

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-12 : 12:00:20
put data flow task inside for each loop with file enumerator and inside for each loop add a variable to get xml file name. then use it in the data flow task by adding a derived column to add to pipeline and insert into the destination table. for lastupdate add date based on @[System::StartTime]

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

Go to Top of Page

sandesh.ravi
Posting Yak Master

110 Posts

Posted - 2011-09-14 : 06:03:20
Thank you Visakh. I successfully executed the package.

One more input required.

I have to call a SSIS package from an SQL job.

The first step of the job shoulld be checking the existance of the file( which is the best way to do it?)

Later the 2nd step is SSIS package execution.

Thanks in advance,
Sandesh

Thanks,
Sandesh
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-14 : 08:52:06
you can do it with xp_fileexist extended proc

http://www.mssqltips.com/sqlservertip/1272/file-validation-in-sql-server-with-xpfileexist-stored-procedure/

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

Go to Top of Page
   

- Advertisement -