Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
'This script returns sucsess if the export file does not exist
'and returns falure if the file exists.
'The rest of the DTS package is not run if the file exists as
Function Main()
Dim fso
Dim FileSpec
'This path & file name should be the'Text File Destination' connection
Const FileName = "Your file name"
Const Path = "The path from the SQL server"
FileSpec = Path & FileName
Set fso = CreateObject("Scripting.FileSystemObject")
If Not (fso.FileExists(FileSpec)) Then
Main = DTSTaskExecResult_Success
Else
Main = DTSTaskExecResult_Failure
End if
End Function
CREATE PROCEDURE [dbo].[USP_Advances]@Name varchar(100),
@No varchar(50),
@DueDate datetime,
@PayDate datetime,
@Amount numeric (9,2), @InvoiceNo varchar(50),
DECLARE @UploadDir varchar(1000)
DECLARE @UploadData varchar(4000)
DECLARE @MergeFileName varchar(100)
SET @UploadDir = '\\MyServer\testdata\'
SET @MergeFileName = 'merge.txt'
SET @UploadData = ' echo ' + @Name + ',' + @No + ',' + CONVERT(char(8),@DueDate,1) + ',' + CONVERT(char(8),@PayDate,1) + ',' + CONVERT(varchar(15),@Amount) + ' > ' + @UploadDir + @MergeFileName
EXEC master..xp_cmdshell @UploadData
EXEC master..xp_cmdshell 'COPY \\MyServer\testdata\advances.txt + \\MyServer\testdata\merge.txt
\\MyServer\testdata\advances.txt '