Reputation: 305
In my Project, I want to create one empty text file when the package triggered.
Upvotes: 3
Views: 7398
Reputation: 1
It might be good idea to dispose of the FileStream
object after using the File.Create
method to avoid locking issues.
Read more here System.IO.File.Create locking a file
Upvotes: 0
Reputation: 61211
I'd probably just use a one-line Script task.
System.IO.File.Create(@"C:\OneEmptyTextFile.txt");
Script Task
from your SSIS Tool BoxScript Task
Edit Script...
public void Main()
section, where it states // TODO: Add your code here
replace that line with the above code. If you are using SSIS 2005 or if you have chosen to use VB.NET in 2008/2012, please remove the trailing semicolon.OK
.Now whenever that Task runs, it will use the static Create method of the File object to create a file in the requested location.
Upvotes: 9