Monday, March 12, 2012

ms sql dts package

I created a DTS package, which has a vbscript file to create a new directory, when i run it directly from the command line “DOS” C:\>dtsrun /Sxxxxxxxx /u!xxxx /pxxxxxx /NZOOT_NDM_COPY_and_ZIP_SCORECARD

, I get:
DTSRun: Loading...
DTSRun: Executing...
DTSRun OnStart: DTSStep_DTSActiveScriptTask_3
DTSRun OnFinish: DTSStep_DTSActiveScriptTask_3
DTSRun OnStart: DTSStep_DTSActiveScriptTask_1
DTSRun OnFinish: DTSStep_DTSActiveScriptTask_1
DTSRun OnStart: DTSStep_DTSActiveScriptTask_2
DTSRun OnError: DTSStep_DTSActiveScriptTask_2, Error = -2147220482 (800403FE)
Error string: Error Code: 0
Error Source= Microsoft VBScript runtime error
Error Description: Path not found
Error on Line 12
Error source: Microsoft Data Transformation Services (DTS) Package
Help file: sqldts80.hlp
Help context: 4500
Error Detail Records:
Error: -2147220482 (800403FE); Provider Error: 0 (0)
Error string: Error Code: 0
Error Source= Microsoft VBScript runtime error
Error Description: Path not found
Error on Line 12
Error source: Microsoft Data Transformation Services (DTS) Package
Help file: sqldts80.hlp
Help context: 4500
DTSRun OnFinish: DTSStep_DTSActiveScriptTask_2
Error: -2147220440 (80040428); Provider Error: 0 (0)
Error string: Package failed because Step 'DTSStep_DTSActiveScriptTask_2' failed.
Error source: Microsoft Data Transformation Services (DTS) Package
Help file: sqldts80.hlp
Help context: 700

'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
Function Main()
Dim fso,f1,f8,s,fldr,drv,fc,f
Set fso = CreateObject("Scripting.FileSystemObject")
f8 = DTSGlobalVariables("DATA_PATH").Value
' CREATE TODAYS FOLDER
if fso.FolderExists(f8&"\ZOOT_"&FormatDateTime(now,VBSHORTDATE)) then = LINE 12
'msgbox "directory Exists"
else
fso.CreateFolder (f8&"\ZOOT_"&FormatDateTime(now,VBSHORTDATE))
end if
' LOOP Through Files
'Change to a variable
Set f = fso.GetFolder(f8)
Set fc = f.Files
For Each f1 in fc
if cdate(left(f1.DateLastModified,10)) = cdate(datevalue(NOW)) then
f1.move (f8& "\ZOOT_"&FormatDateTime(now,VBSHORTDATE) &"\"&f1.name)
end if
' msgbox f1.name
Next
Main = DTSTaskExecResult_Success
End FunctionPlease verify the following:

Have you created a DTS from you EM Client or directly on the server ?

If this is the scenario then it gives you error. Instead of specifying the path like "c:\foldername\" try to give the UNC e.g \\servername\foldername"

May be it will help you

Thanks|||And ensure login used to execute the package has required privilege to complete the task or if you've scheduled same for the SQLAgent service account.

No comments:

Post a Comment