Blog Post

Execute SSIS Packages with a Macro in BIDS

,

When running SSIS packages in BIDS it is common to click on the green arrow at the top of BIDS to run a package.

clip_image001

One problem that can occur when using this button is the deployment of project and the creation of the deployment manifest file. If you have turned on deployment for the project under the Project Properties then this green arrow will now run the package and deploy.

clip_image002

To avoid this issue you can right click on the package in the solution explorer which will only execute the package.

clip_image003

This is inconvenient for me, because I place the solution explorer behind the properties window. I do this because there are a lot of properties and it is easier to find the properties I am looking for when the properties window is stretched out.

clip_image004

To give you the ability to launch a package from the toolbar without deploying you can create a macro. It is very simple and only takes a minute to create it.

1. At the tops of BIDS click on View > Other Windows > Macro Explorer

clip_image005

2. In the Macro Window right click on Module1 > New Macro

3. Change the Sub Name to ExecutePackage()

4. Enter the following Code:

DTE.ExecuteCommand(“ProjectandSolutionContextMenus.Item.ExecutePackage”)

clip_image007

5. Save and Close the Macro Editor

6. Close the Macro Explorer

Now you have created the Macro that will execute a package. The next step is to add it to the toolbar.

1. Click on the toolbar drop down menu at the end of the toolbar where you want to add the macro and select Add or Remove Buttons > Customize

clip_image008

2. Click on the Commands Tab and select Macros from the Categories list

clip_image009

3. Drag the Execute Package Macro onto the toolbar where you want the button to appear

4. Right click on the new button and select Change Button Image, Select the image of your choice

clip_image010

5. Right Click on the new image in the toolbar and select Text Only in Menus.

Now you should have a new button on the toolbar. This macro button will launch the package that is currently focused on in BIDS.

clip_image011

You cannot use this button if you already have a package running in debug mode. You will see an error if you do this.clip_image012

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating