I’d completely forgotten you could right-click on a package, click “View Code” and change the package’s XML configuration. But, you can, and we will.
I’m going to create a very simple package.
Step 1: Create a new project and/or a new package.
You know how to do this so do it and name them whatever you would like.
Step 2: Create the Data Flow task.
- Create a Data Flow task (drag and drop or click the Data Flow tab).
- Drag a OLE DB Source to the Data Flow.
- Configure the connection manager to point to AdventureWorks2012, set “Data access mode” to “Table or view” and pick a table. I used [Production].[Location].
- Drag a Flat File destination to the Data Flow and connect the OLE DB source to it.
- Configure it to point to a file of your choosing. I used C:\testData\junk.txt. Make sure this is a new file, and not an existing file. It may work but I didn’t test if it did.
Step 3: Use “View Code” to change the package.
In the Solution explorer, right-click the package, select “View Code” and do the following:
- Hit CTL-f to bring up the “Find and Replace” dialogue window.
- I searched for junk.txt but if you named your file something else search for that.
- Rename the file. In my case, I changed junk.txt to notMyJunk.txt.
If you run the package you will see that the process ran, and it renamed the destination file to notMyJunk.txt.
Anyways, one more way to configure a SSIS package and I sincerely hope it’s the last one I write about.