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
 New to SQL Server Programming
 flat file connection manager

Author  Topic 

moumona
Starting Member

2 Posts

Posted - 2013-10-25 : 09:21:52
I would like to set up the flat file connection manager that would take any file name that starts with "test" and then it could be anything after that. Something like test_*.txt. Can someone please advise how do I make this work?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-25 : 09:25:54
you need to set an expression for connection string property of flat file connection manager for that. In expression make first part statis ("test"). then add an expression based on your requirement to get rest of the part.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

moumona
Starting Member

2 Posts

Posted - 2013-10-25 : 09:36:01
Thanks Visakh16 for replying. I did do that. I put the filename path and the first static part in to a variable and referenced it in the Expression. But how do I use the second part? How do I concatenate that part?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-25 : 22:44:41
whats the rule for that? if you specify that, I may suggest an expression.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

waterduck
Aged Yak Warrior

982 Posts

Posted - 2013-10-27 : 21:33:01
hi, you could utilize the "Foreach Loop Container" to loop all the file in the folder, later on you can use the "Expression Task" to check the file name same as your rule.
Go to Top of Page
   

- Advertisement -