![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I would like to keep a FileSystemObject open across phases. Specifically, I would like to open a text file during the Pre Source phase, write to that file in the Row Transform phase, then close the file in the Post Source phase. I thought I could keep the FileSystemObject in a Global Variable. I have been unsuccessful in my attempts. Does anyone have an example of doing something like this? Thank you. Gary |
#3
| |||
| |||
|
|
I haven't tried, but a guess would be set Execute on main thread in case the task phase split accross threads. Right-click the task, Workflow Properties. Darren Green http://www.sqldts.com http://www.sqlis.com "Gary" <GAry> wrote in message news:%23l%23bMqnSFHA.3236 (AT) tk2msftngp13 (DOT) phx.gbl... I would like to keep a FileSystemObject open across phases. Specifically, I would like to open a text file during the Pre Source phase, write to that file in the Row Transform phase, then close the file in the Post Source phase. I thought I could keep the FileSystemObject in a Global Variable. I have been unsuccessful in my attempts. Does anyone have an example of doing something like this? Thank you. Gary |
#4
| |||
| |||
|
|
I can't get far enough for that to be a problem. I can't seem to store an object in a Global Variable and retrieve it. Any examples? I could re-open the file for append each time I get to the Row Transform phase, but that seems like a lot of overhead. Gary "Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in message news:#Or5m5nSFHA.3088 (AT) TK2MSFTNGP15 (DOT) phx.gbl... I haven't tried, but a guess would be set Execute on main thread in case the task phase split accross threads. Right-click the task, Workflow Properties. Darren Green http://www.sqldts.com http://www.sqlis.com "Gary" <GAry> wrote in message news:%23l%23bMqnSFHA.3236 (AT) tk2msftngp13 (DOT) phx.gbl... I would like to keep a FileSystemObject open across phases. Specifically, I would like to open a text file during the Pre Source phase, write to that file in the Row Transform phase, then close the file in the Post Source phase. I thought I could keep the FileSystemObject in a Global Variable. I have been unsuccessful in my attempts. Does anyone have an example of doing something like this? Thank you. Gary |
#5
| |||
| |||
|
|
I don't understand. Why can you not store and retrieve it? Errors? Not an open file, but the idea is the same- Dim oFSO Set oFSO = CreateObject("Scripting.FileSystemObject") ..blah blah... Set DTSGlobalVariables("FileObject").Value = oFSO Dim oFSO2 Set oFSO2 = DTSGlobalVariables("FileObject").Value Darren Green http://www.sqldts.com http://www.sqlis.com "Gary" <GAry> wrote in message news:e1avf%23nSFHA.164 (AT) TK2MSFTNGP12 (DOT) phx.gbl... I can't get far enough for that to be a problem. I can't seem to store an object in a Global Variable and retrieve it. Any examples? I could re-open the file for append each time I get to the Row Transform phase, but that seems like a lot of overhead. Gary "Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in message news:#Or5m5nSFHA.3088 (AT) TK2MSFTNGP15 (DOT) phx.gbl... I haven't tried, but a guess would be set Execute on main thread in case the task phase split accross threads. Right-click the task, Workflow Properties. Darren Green http://www.sqldts.com http://www.sqlis.com "Gary" <GAry> wrote in message news:%23l%23bMqnSFHA.3236 (AT) tk2msftngp13 (DOT) phx.gbl... I would like to keep a FileSystemObject open across phases. Specifically, I would like to open a text file during the Pre Source phase, write to that file in the Row Transform phase, then close the file in the Post Source phase. I thought I could keep the FileSystemObject in a Global Variable. I have been unsuccessful in my attempts. Does anyone have an example of doing something like this? Thank you. Gary |
#6
| |||
| |||
|
|
Yes, I'm getting errors. I'm reworking what I'm doing to see if I can isolate where the problem is. Gary "Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in message news:uXEYqVoSFHA.1312 (AT) TK2MSFTNGP14 (DOT) phx.gbl... I don't understand. Why can you not store and retrieve it? Errors? Not an open file, but the idea is the same- Dim oFSO Set oFSO = CreateObject("Scripting.FileSystemObject") ..blah blah... Set DTSGlobalVariables("FileObject").Value = oFSO Dim oFSO2 Set oFSO2 = DTSGlobalVariables("FileObject").Value Darren Green http://www.sqldts.com http://www.sqlis.com "Gary" <GAry> wrote in message news:e1avf%23nSFHA.164 (AT) TK2MSFTNGP12 (DOT) phx.gbl... I can't get far enough for that to be a problem. I can't seem to store an object in a Global Variable and retrieve it. Any examples? I could re-open the file for append each time I get to the Row Transform phase, but that seems like a lot of overhead. Gary "Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in message news:#Or5m5nSFHA.3088 (AT) TK2MSFTNGP15 (DOT) phx.gbl... I haven't tried, but a guess would be set Execute on main thread in case the task phase split accross threads. Right-click the task, Workflow Properties. Darren Green http://www.sqldts.com http://www.sqlis.com "Gary" <GAry> wrote in message news:%23l%23bMqnSFHA.3236 (AT) tk2msftngp13 (DOT) phx.gbl... I would like to keep a FileSystemObject open across phases. Specifically, I would like to open a text file during the Pre Source phase, write to that file in the Row Transform phase, then close the file in the Post Source phase. I thought I could keep the FileSystemObject in a Global Variable. I have been unsuccessful in my attempts. Does anyone have an example of doing something like this? Thank you. Gary |
#7
| |||
| |||
|
|
What is the full error message? In message <erje0VpSFHA.3732 (AT) TK2MSFTNGP10 (DOT) phx.gbl>, Gary GAry@?.?.invalid> writes Yes, I'm getting errors. I'm reworking what I'm doing to see if I can isolate where the problem is. Gary "Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in message news:uXEYqVoSFHA.1312 (AT) TK2MSFTNGP14 (DOT) phx.gbl... I don't understand. Why can you not store and retrieve it? Errors? Not an open file, but the idea is the same- Dim oFSO Set oFSO = CreateObject("Scripting.FileSystemObject") ..blah blah... Set DTSGlobalVariables("FileObject").Value = oFSO Dim oFSO2 Set oFSO2 = DTSGlobalVariables("FileObject").Value Darren Green http://www.sqldts.com http://www.sqlis.com "Gary" <GAry> wrote in message news:e1avf%23nSFHA.164 (AT) TK2MSFTNGP12 (DOT) phx.gbl... I can't get far enough for that to be a problem. I can't seem to store an object in a Global Variable and retrieve it. Any examples? I could re-open the file for append each time I get to the Row Transform phase, but that seems like a lot of overhead. Gary "Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in message news:#Or5m5nSFHA.3088 (AT) TK2MSFTNGP15 (DOT) phx.gbl... I haven't tried, but a guess would be set Execute on main thread in case the task phase split accross threads. Right-click the task, Workflow Properties. Darren Green http://www.sqldts.com http://www.sqlis.com "Gary" <GAry> wrote in message news:%23l%23bMqnSFHA.3236 (AT) tk2msftngp13 (DOT) phx.gbl... I would like to keep a FileSystemObject open across phases. Specifically, I would like to open a text file during the Pre Source phase, write to that file in the Row Transform phase, then close the file in the Post Source phase. I thought I could keep the FileSystemObject in a Global Variable. I have been unsuccessful in my attempts. Does anyone have an example of doing something like this? Thank you. Gary -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org |
![]() |
| Thread Tools | |
| Display Modes | |
| |