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)
 Execute SQL Task

Author  Topic 

AKP2008
Starting Member

45 Posts

Posted - 2008-12-18 : 23:28:26
Hi All,

I have to import data from 100 text files into a table.

My requirement is to save filename also in the table.

how can i get the filename while importing data into table.

please help.

Thanks

rgombina
Constraint Violating Yak Guru

319 Posts

Posted - 2008-12-22 : 06:45:42
1) Use ForEach Loop File Enumerator
2) Collection: Retrieve file name = fully qualified if you want with file path
3) Variable Mappings: Variable = User::filename, Index = 0
4) In your import task, include User::filename to the designated column

That should do it. Let us know if you need more details than this. Thanks.
Go to Top of Page
   

- Advertisement -