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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script Task - Write and Append messages to Text file

Status
Not open for further replies.

ReportDr00

IS-IT--Management
Mar 2, 2007
194
0
0
US
Hello

I am using Streamwriter as below but it writes only the last message instead of appending to the file?
I am doing this in script task of SSIS.

Using writer As StreamWriter = New StreamWriter("C:\STExceptionLog.txt")

writer.WriteLine()
writer.Write(ex.ToString)

writer.Flush()
writer.Close()
End Using

how could i add and append log messages to the text file in Script task?
 

Create your stream writer in append mode thusly:

Using writer As StreamWriter = New StreamWriter("C:\STExceptionLog.txt",true)

Don
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top