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 |
|
NJDba
Starting Member
31 Posts |
Posted - 2007-11-15 : 16:31:17
|
| In SSIS, I put a File System Task in a Foreach Loop Container to do some file operation. I check the Traverse Subfolders in the Loop, and I want to take a look the full path name during operation. I'd like to show the full path name on a message box? How should I do?Thanks. |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2007-11-15 : 17:01:10
|
Add a Script Task to your Loop container. Pass the variable that you assign the FileName to as a ReadOnly variable to the script task. Then show the message box (assuming FileName is your local variable name): MsgBox(Dts.Variables("FileName").Value.ToString()) |
 |
|
|
NJDba
Starting Member
31 Posts |
Posted - 2007-11-15 : 17:07:58
|
| Got it, thank you very much. |
 |
|
|
NJDba
Starting Member
31 Posts |
Posted - 2007-11-15 : 17:36:04
|
| One more question. When set up the Foreach Loop Container, I can set up the parent directory, and then set up the variable mapping, which is the file name. I check the traverse subfolders in Loop, but how can I see the full path, I mean including the subfolder name? Right now, the full path name is not correct. Say:It should be c:\parent folder\subfolder\filename.bak, but it is c:\parent folder\filename.bak now.What should I do?Any suggestion would be appreciated. |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2007-11-15 : 18:35:37
|
| Humm, it should show you the full path name. On the properties of the For Each Loop Container under the Collection "tab" (thing on the side (is there a name for that??)) you should just need to check "Fully Qualified" in the "Retrieve file name" section and also check "Traverse subfolders". Other than that I'm not sure. |
 |
|
|
NJDba
Starting Member
31 Posts |
Posted - 2007-11-15 : 19:32:32
|
| When I put MsgBox(Dts.Variables("FileName").Value.ToString()) in my script task, only file name is pop up, how can I add the full directory to it?Thanks |
 |
|
|
NJDba
Starting Member
31 Posts |
Posted - 2007-11-15 : 19:40:48
|
| Sorry for the stupid question.In the Foreach Loop, I click the Fully Qualified, and it's done. |
 |
|
|
|
|
|
|
|