Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

DTS DTSGloabalVariables Save file in variable Finallocation problem Expand / Collapse
Author
Message
Posted Friday, May 10, 2013 2:19 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Today @ 3:15 AM
Points: 6, Visits: 380
I have made script 1 to generate a file and script 2 to generate the location. The goal is that when the file is created it is moved/saved into the new folder that is created. The problem is I cannot seem to get this to work. I would like to integrate script 2 into script 1 but every attempt so far fails. So can anyone help me out to integrate script 2 for the Finallocation?
(SQL 2000)

Script 1
'**********************************************************************
' Visual Basic ActiveX Script
Function Main()

Dim fileName
fileName = "OnlineBilling_" & DatePart("yyyy", Date) & Right("0" & DatePart("m", Date), 2) & Right("0" & DatePart("d", Date), 2) & "_" & Right("0" & DatePart("h",Now), 2) & Right("0" & DatePart("n",Now), 2) & Right("0" & DatePart("s",Now), 2)
DTSGlobalVariables("FinalLocation").Value = DTSGlobalVariables("NetworkLocation").Value + fileName + ".xls"

Main = DTSTaskExecResult_Success

End Function


Script 2
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Option Explicit

Function Main()

Dim objFSO, dNow, yyyy, mt, dd, hh, nn, ss, NewFolder
Set objFSO = CreateObject("Scripting.FileSystemObject")

dNow = Now
yyyy = Right(Year(dNow), 4)
mt = Right("00" & Month(dNow), 2)
dd = Right("00" & Day(dNow), 2)
hh = Right("00" & Hour(dNow), 2)
nn = Right("00" & Minute(dNow), 2)
ss = Right("00" & Second(dNow), 2)
NewFolder = "E:\Online\" & yyyy & "_" & dd & mt & "_" & hh & nn & ss

'Create the folder
objFSO.CreateFolder NewFolder

Set objFSO= Nothing

Main = DTSTaskExecResult_Success
End Function
Post #1451465
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse