SSIS Packages: Rename the Package Object as Well?

When you create a new Integration Services (SSIS) package in Visual Studio, it's named Package1.dtsx by default.  When you rename the package – and you should always rename the package to something meaningful – you're asked "Do you want to rename the package object as well?"  You'll want to answer YES every time. Donald Farmer clarified this in the MSDN forums:  

In Visual Studio you rename a file – the *.dtsx file. However, the SSIS package is an object in the file. So if you don't rename the object you could have a package file called MySuperPackage.dtsx containing a package object called MyOldPackage. Try saying no to the dialog once and check the name property of the package in the properties window – select the package by clicking in the background of the object explorer.

I tried an experiment: I created a new package and renamed the file "Package1.dtsx" to "Meaningful.dtsx". When the rename package object dialog appeared, I clicked No.  Let's take a look at the code…down near the bottom you'll see this:

<DTS:LoggingOptions>
<
DTS:Property DTS:Name="LoggingMode">0</DTS:Property>
<
DTS:Property DTS:Name="FilterKind">1</DTS:Property>
<
DTS:Property DTS:Name="EventFilter" DTS:DataType="8"></DTS:Property></DTS:LoggingOptions>
<DTS:Property DTS:Name="ObjectName">Package1</DTS:Property>

<
DTS:Property DTS:Name="DTSID">{7F058592-B791-4A54-BFAA-E49BC5E99365}</DTS:Property>
<
DTS:Property DTS:Name="Description"></DTS:Property>
<
DTS:Property DTS:Name="CreationName">MSDTS.Package.1</DTS:Property>
<
DTS:Property DTS:Name="DisableEventHandlers">0</DTS:Property></DTS:Executable>

The file is named Meaningful.dtsx (not shown), but the DTS:Name="ObjectName" is still Package1.  When I deployed this, the package name in SQL Server was Package1; it ignored the file rename.  This will cause problems if you do this with different packages; each has a different filename, but each is deployed as Package1, so it'll get overwritten. 

So that's a long way of saying: Rename the file, click Yes to rename the object.

-Jen McCown, http://www.MidnightDBA.com