Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure data appending 1

Status
Not open for further replies.

mtepfer

IS-IT--Management
Apr 21, 2003
55
US
First off am new to this and have inherited some stuff so will try to make it as clear as possible.

We are using crystal reports, the report i run gets its data from a stored procedure. Every day a DTS package runs that extracts from the Unidata database 2 files and combines them into a CSV file. This file is then brought into SQL. What is happening is every time it runs it adds onto the file instead of just adding any new entries. What do i need to do to stop it from appending.
 
I don't think DTS will let you just TRUNCATE the text file. One way I can think of is to use an ActiveX script to delete the text file and recreate it. This should run before the extract and combine. Good luck!
Code:
Function Main()
	DIM oFSO
	DIM oTextFile

	IF oFSO.FileExists("FilePathAndName") THEN
		oFSO.DeleteFile ("FilePathAndName")
	END IF

	SET oTextFile = oFSO.CreateTextFile("FilePathAndName", True)

	oTextFile.Close

	SET oTextFile = nothing
	SET oFSO = nothing

	Main = DTSTaskExecResult_Success
End Function

--John [rainbow]
-----------------------------------
Behold! As a wild ass in the desert
go forth I to do my work.
--Gurnie Hallock (Dune)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top