By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
In the following example, the file name is stored in a global variable.
Function Main() Dim oFSO, sFileName ' Get the name of the file from the global variable "ImportFileName" sFilename = DTSGlobalVariables("ImportFileName").Value Set oFSO = CreateObject("Scripting.FileSystemObject") ' Check for file and return appropriate result If oFSO.FileExists(sFilename) Then Main = DTSStepScriptResult_ExecuteTask Else Main = DTSStepScriptResult_DontExecuteTask End If Set oFSO = Nothing End Function
Related Q&A from Joe Toscano
Is there a query to search text in a SQL Server DTS package? SQL Server expert Joe Toscano explains which database objects can be viewed.continue reading
Convert SQL Server 2000 DTS packages to SQL Server 2005 with this advice and also see how to overwrite data.continue reading
Getting an error when importing data from an Excel spreadsheet to SSIS in SQL Server 2005? Try lining up data types in Excel and SSIS so they match.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.