6

I created a SSIS Package in Visual Studio SSDT 2012, using Package Deployment model. Is there any way to get access to the package's file name as a readonly variable or property from within the package?

I don't see it listed as a system variable, is there any way maybe through the script task?

Jason R.
  • 379
  • 1
  • 6
  • 19
  • I thought PackageName and PackageFileName were the same too, but they aren't. They are two different values. You can rename your SSIS package file 'ABC', but the package name will still be the default 'package' @JonathonOgden – Jason R. Mar 13 '16 at 17:27
  • Also, is you are using Project Deployment, you can see it as a Parameter but I'm forced to use Package Deployment. @JonathonOgden – Jason R. Mar 13 '16 at 17:31
  • 1
    apologies, misread your title. Without hard-coding a variable with the file name (fully qualified or otherwise), the only programmatic way I can think of depends on whether or not you have a Connection Manager in your project and querying [GetPackagePath](https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.connectionmanager.getpackagepath.aspx) in a ScriptTask at runtime. Just a theory though. – Jonathon Ogden Mar 13 '16 at 18:31
  • In retrospect, that returns it relative to the package and not the package's location on your hard-disk. Attempting some ScriptTask coding for you at the moment. – Jonathon Ogden Mar 13 '16 at 18:35
  • So Thankful @JonathonOgden for any help you can provide – Jason R. Mar 13 '16 at 19:53

1 Answers1

2

I think you need to check System variables in the name of [System::PackageName], if you want to rename the package name,then you have to change the Properties. I've attached screenshots for your reference. Select Variables , Properties.

StackUseR
  • 884
  • 1
  • 11
  • 40
Thangadurai.B
  • 561
  • 1
  • 3
  • 18