26 Apr

SSIS: View Code

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.

  1. Create a Data Flow task (drag and drop or click the Data Flow tab).
  2. Drag a OLE DB Source to the Data Flow.
  3. Configure the connection manager to point to AdventureWorks2012, set “Data access mode” to “Table or view” and pick a table.  I used [Production].[Location].
  4. Drag a Flat File destination to the Data Flow and connect the OLE DB source to it.
  5. 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.
View Code.

View Code.

Step 3: Use “View Code” to change the package.

In the Solution explorer, right-click the package, select “View Code” and do the following:

  1. Hit CTL-f to bring up the “Find and Replace” dialogue window.
  2. I searched for junk.txt but if you named your file something else search for that.
  3. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *