dbTalk Databases Forums  

Execute Process task fails after package is saved

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Execute Process task fails after package is saved in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #41  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: Execute Process task fails after package is saved - 06-03-2008 , 11:34 AM






On Jun 3, 4:33*pm, Bouce <Bo... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Yip...
Basically it renames a file in the same directory:
@ECHO OFF
FOR %%V IN (latestdcm.csv) DO FOR /F "tokens=1-5 delims=/: " %%J IN
("%%~tV") DO Rename "%%V" %%K%%J%%L%%~xV



"jhofm... (AT) googlemail (DOT) com" wrote:
On Jun 3, 2:20 pm, Bouce <Bo... (AT) discussions (DOT) microsoft.com> wrote:
Hi J

Unfortunately that is the only error I see. *I literally set the path,
successfully run the step. then sace and close my package and re-open just to
execute that step again and get this message... *if I re-select the path
again it works again...

"jhofm... (AT) googlemail (DOT) com" wrote:
Hi Bouce,

Is that the only error message? *Seems like it is trying to run, but
the BAT file isn't working ... usually when SSIS fails it produces a
number of error messages, and sometimes the one that is the actual
problem is not apparent

Good luck!
J- Hide quoted text -

- Show quoted text -

Hmmm ... strange. *What does the .BAT file do?- Hide quoted text -

- Show quoted text -
I'm assuming that this batch file can't return a "failed" status (e.g.
if it can't find latestdcm.csv?)


Reply With Quote
  #42  
Old   
PittsburghCodeMonkey
 
Posts: n/a

Default Re: Execute Process task fails after package is saved - 06-03-2008 , 01:34 PM






You could get rid of the bat file and use a active x script inside of
the DTS package. Attached is a code snippet....



'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
' This will rename a file then go ahead and copy it to a archived
location

Function Main()

'Declare all of the variables that are necessary in order to complete
the task
Dim oFSO
Dim sDestinationFile
Dim sFile
Dim sFileNewName
Dim Today
Dim strDate

'Setting the variables
Today = Date()

'This is going to be used to append to the end of the file name as MM-
DD-YYYY
strDate = Right("0" & Month(Today), 2) & "-" & Right("0" &
Day(Today),2) & "-" & Year(Today)

'This is the source file that the DTS Package created
sFile = "\\SERVERNAME\IT\IT\DTS Templates\Working
\DTSPackageExport.xls"

'This is the destination file that we want the source file to be
copied to
'(We will rename this for archival purposes)
'The file will be saved in this directory: (if the day is 06/03/2008)
'\\Differentservername\DTS Exported Data\2008\06-03-2008 DTSPackage
Export.xls
sDestinationFile = "\\Differentservername\DTS Exported Data\"&
Year(Today) & "\" & strDate & " - DTSPackage Export.xls"

'This is the step that is going to do the copy
Set oFSO = CreateObject("Scripting.FileSystemObject")
oFSO.CopyFile sFile, sDestinationFile

'Clean Up
Set oFSO = Nothing

Main = DTSTaskExecResult_Success
End Function

Reply With Quote
  #43  
Old   
PittsburghCodeMonkey
 
Posts: n/a

Default Re: Execute Process task fails after package is saved - 06-03-2008 , 01:34 PM



You could get rid of the bat file and use a active x script inside of
the DTS package. Attached is a code snippet....



'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
' This will rename a file then go ahead and copy it to a archived
location

Function Main()

'Declare all of the variables that are necessary in order to complete
the task
Dim oFSO
Dim sDestinationFile
Dim sFile
Dim sFileNewName
Dim Today
Dim strDate

'Setting the variables
Today = Date()

'This is going to be used to append to the end of the file name as MM-
DD-YYYY
strDate = Right("0" & Month(Today), 2) & "-" & Right("0" &
Day(Today),2) & "-" & Year(Today)

'This is the source file that the DTS Package created
sFile = "\\SERVERNAME\IT\IT\DTS Templates\Working
\DTSPackageExport.xls"

'This is the destination file that we want the source file to be
copied to
'(We will rename this for archival purposes)
'The file will be saved in this directory: (if the day is 06/03/2008)
'\\Differentservername\DTS Exported Data\2008\06-03-2008 DTSPackage
Export.xls
sDestinationFile = "\\Differentservername\DTS Exported Data\"&
Year(Today) & "\" & strDate & " - DTSPackage Export.xls"

'This is the step that is going to do the copy
Set oFSO = CreateObject("Scripting.FileSystemObject")
oFSO.CopyFile sFile, sDestinationFile

'Clean Up
Set oFSO = Nothing

Main = DTSTaskExecResult_Success
End Function

Reply With Quote
  #44  
Old   
PittsburghCodeMonkey
 
Posts: n/a

Default Re: Execute Process task fails after package is saved - 06-03-2008 , 01:34 PM



You could get rid of the bat file and use a active x script inside of
the DTS package. Attached is a code snippet....



'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
' This will rename a file then go ahead and copy it to a archived
location

Function Main()

'Declare all of the variables that are necessary in order to complete
the task
Dim oFSO
Dim sDestinationFile
Dim sFile
Dim sFileNewName
Dim Today
Dim strDate

'Setting the variables
Today = Date()

'This is going to be used to append to the end of the file name as MM-
DD-YYYY
strDate = Right("0" & Month(Today), 2) & "-" & Right("0" &
Day(Today),2) & "-" & Year(Today)

'This is the source file that the DTS Package created
sFile = "\\SERVERNAME\IT\IT\DTS Templates\Working
\DTSPackageExport.xls"

'This is the destination file that we want the source file to be
copied to
'(We will rename this for archival purposes)
'The file will be saved in this directory: (if the day is 06/03/2008)
'\\Differentservername\DTS Exported Data\2008\06-03-2008 DTSPackage
Export.xls
sDestinationFile = "\\Differentservername\DTS Exported Data\"&
Year(Today) & "\" & strDate & " - DTSPackage Export.xls"

'This is the step that is going to do the copy
Set oFSO = CreateObject("Scripting.FileSystemObject")
oFSO.CopyFile sFile, sDestinationFile

'Clean Up
Set oFSO = Nothing

Main = DTSTaskExecResult_Success
End Function

Reply With Quote
  #45  
Old   
PittsburghCodeMonkey
 
Posts: n/a

Default Re: Execute Process task fails after package is saved - 06-03-2008 , 01:34 PM



You could get rid of the bat file and use a active x script inside of
the DTS package. Attached is a code snippet....



'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
' This will rename a file then go ahead and copy it to a archived
location

Function Main()

'Declare all of the variables that are necessary in order to complete
the task
Dim oFSO
Dim sDestinationFile
Dim sFile
Dim sFileNewName
Dim Today
Dim strDate

'Setting the variables
Today = Date()

'This is going to be used to append to the end of the file name as MM-
DD-YYYY
strDate = Right("0" & Month(Today), 2) & "-" & Right("0" &
Day(Today),2) & "-" & Year(Today)

'This is the source file that the DTS Package created
sFile = "\\SERVERNAME\IT\IT\DTS Templates\Working
\DTSPackageExport.xls"

'This is the destination file that we want the source file to be
copied to
'(We will rename this for archival purposes)
'The file will be saved in this directory: (if the day is 06/03/2008)
'\\Differentservername\DTS Exported Data\2008\06-03-2008 DTSPackage
Export.xls
sDestinationFile = "\\Differentservername\DTS Exported Data\"&
Year(Today) & "\" & strDate & " - DTSPackage Export.xls"

'This is the step that is going to do the copy
Set oFSO = CreateObject("Scripting.FileSystemObject")
oFSO.CopyFile sFile, sDestinationFile

'Clean Up
Set oFSO = Nothing

Main = DTSTaskExecResult_Success
End Function

Reply With Quote
  #46  
Old   
PittsburghCodeMonkey
 
Posts: n/a

Default Re: Execute Process task fails after package is saved - 06-03-2008 , 01:34 PM



You could get rid of the bat file and use a active x script inside of
the DTS package. Attached is a code snippet....



'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
' This will rename a file then go ahead and copy it to a archived
location

Function Main()

'Declare all of the variables that are necessary in order to complete
the task
Dim oFSO
Dim sDestinationFile
Dim sFile
Dim sFileNewName
Dim Today
Dim strDate

'Setting the variables
Today = Date()

'This is going to be used to append to the end of the file name as MM-
DD-YYYY
strDate = Right("0" & Month(Today), 2) & "-" & Right("0" &
Day(Today),2) & "-" & Year(Today)

'This is the source file that the DTS Package created
sFile = "\\SERVERNAME\IT\IT\DTS Templates\Working
\DTSPackageExport.xls"

'This is the destination file that we want the source file to be
copied to
'(We will rename this for archival purposes)
'The file will be saved in this directory: (if the day is 06/03/2008)
'\\Differentservername\DTS Exported Data\2008\06-03-2008 DTSPackage
Export.xls
sDestinationFile = "\\Differentservername\DTS Exported Data\"&
Year(Today) & "\" & strDate & " - DTSPackage Export.xls"

'This is the step that is going to do the copy
Set oFSO = CreateObject("Scripting.FileSystemObject")
oFSO.CopyFile sFile, sDestinationFile

'Clean Up
Set oFSO = Nothing

Main = DTSTaskExecResult_Success
End Function

Reply With Quote
  #47  
Old   
PittsburghCodeMonkey
 
Posts: n/a

Default Re: Execute Process task fails after package is saved - 06-03-2008 , 01:34 PM



You could get rid of the bat file and use a active x script inside of
the DTS package. Attached is a code snippet....



'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
' This will rename a file then go ahead and copy it to a archived
location

Function Main()

'Declare all of the variables that are necessary in order to complete
the task
Dim oFSO
Dim sDestinationFile
Dim sFile
Dim sFileNewName
Dim Today
Dim strDate

'Setting the variables
Today = Date()

'This is going to be used to append to the end of the file name as MM-
DD-YYYY
strDate = Right("0" & Month(Today), 2) & "-" & Right("0" &
Day(Today),2) & "-" & Year(Today)

'This is the source file that the DTS Package created
sFile = "\\SERVERNAME\IT\IT\DTS Templates\Working
\DTSPackageExport.xls"

'This is the destination file that we want the source file to be
copied to
'(We will rename this for archival purposes)
'The file will be saved in this directory: (if the day is 06/03/2008)
'\\Differentservername\DTS Exported Data\2008\06-03-2008 DTSPackage
Export.xls
sDestinationFile = "\\Differentservername\DTS Exported Data\"&
Year(Today) & "\" & strDate & " - DTSPackage Export.xls"

'This is the step that is going to do the copy
Set oFSO = CreateObject("Scripting.FileSystemObject")
oFSO.CopyFile sFile, sDestinationFile

'Clean Up
Set oFSO = Nothing

Main = DTSTaskExecResult_Success
End Function

Reply With Quote
  #48  
Old   
PittsburghCodeMonkey
 
Posts: n/a

Default Re: Execute Process task fails after package is saved - 06-03-2008 , 01:34 PM



You could get rid of the bat file and use a active x script inside of
the DTS package. Attached is a code snippet....



'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
' This will rename a file then go ahead and copy it to a archived
location

Function Main()

'Declare all of the variables that are necessary in order to complete
the task
Dim oFSO
Dim sDestinationFile
Dim sFile
Dim sFileNewName
Dim Today
Dim strDate

'Setting the variables
Today = Date()

'This is going to be used to append to the end of the file name as MM-
DD-YYYY
strDate = Right("0" & Month(Today), 2) & "-" & Right("0" &
Day(Today),2) & "-" & Year(Today)

'This is the source file that the DTS Package created
sFile = "\\SERVERNAME\IT\IT\DTS Templates\Working
\DTSPackageExport.xls"

'This is the destination file that we want the source file to be
copied to
'(We will rename this for archival purposes)
'The file will be saved in this directory: (if the day is 06/03/2008)
'\\Differentservername\DTS Exported Data\2008\06-03-2008 DTSPackage
Export.xls
sDestinationFile = "\\Differentservername\DTS Exported Data\"&
Year(Today) & "\" & strDate & " - DTSPackage Export.xls"

'This is the step that is going to do the copy
Set oFSO = CreateObject("Scripting.FileSystemObject")
oFSO.CopyFile sFile, sDestinationFile

'Clean Up
Set oFSO = Nothing

Main = DTSTaskExecResult_Success
End Function

Reply With Quote
  #49  
Old   
PittsburghCodeMonkey
 
Posts: n/a

Default Re: Execute Process task fails after package is saved - 06-03-2008 , 01:34 PM



You could get rid of the bat file and use a active x script inside of
the DTS package. Attached is a code snippet....



'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
' This will rename a file then go ahead and copy it to a archived
location

Function Main()

'Declare all of the variables that are necessary in order to complete
the task
Dim oFSO
Dim sDestinationFile
Dim sFile
Dim sFileNewName
Dim Today
Dim strDate

'Setting the variables
Today = Date()

'This is going to be used to append to the end of the file name as MM-
DD-YYYY
strDate = Right("0" & Month(Today), 2) & "-" & Right("0" &
Day(Today),2) & "-" & Year(Today)

'This is the source file that the DTS Package created
sFile = "\\SERVERNAME\IT\IT\DTS Templates\Working
\DTSPackageExport.xls"

'This is the destination file that we want the source file to be
copied to
'(We will rename this for archival purposes)
'The file will be saved in this directory: (if the day is 06/03/2008)
'\\Differentservername\DTS Exported Data\2008\06-03-2008 DTSPackage
Export.xls
sDestinationFile = "\\Differentservername\DTS Exported Data\"&
Year(Today) & "\" & strDate & " - DTSPackage Export.xls"

'This is the step that is going to do the copy
Set oFSO = CreateObject("Scripting.FileSystemObject")
oFSO.CopyFile sFile, sDestinationFile

'Clean Up
Set oFSO = Nothing

Main = DTSTaskExecResult_Success
End Function

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.