Formatting Shortcuts in SSIS Package Designer in Business Intelligence Development Studio (BIDS)
Formatting is one of the important aspects of any coding language. Be it SSIS, SSRS, T-SQL, .Net, XML or any other programming language, formatting is important as it helps in keeping the code neat and improves the readability of the code.
While developing packages in SSIS especially when we have many Tasks/Transformations in the package, it is essential that the Tasks/Transformations are sized properly so that the entire name of Task/Transformation is visible and also, each of the Tasks/Transformations should be aligned properly to make it look neat and more readable.
To format the Tasks/Transformations connected to each other in the SSIS package designer, we usually go through the following steps:
Select all the Tasks/Transformations in the designer (Ctrl + A).
Go to Format Menu.
Select Autosize from context menu to re-size all the Tasks/Transformations so that the Name of the Task/Transformation is clearly visible without requiring you to expand the Task/Transformation.
Go to Format -> Auto Layout.
Select Diagram from the context menu to re-align all the Tasks/Transformation to make it look neat and more readable.
Let’s take a look at Bad Practice vs. Good Practice for formatting in SSIS Designer as shown in the below screenshot.
Now let us go ahead and create shortcuts for formatting in SSIS by creating shortcuts for Steps 2 & 3 and Steps 4 & 5 above. Follow the below steps to create the required shortcuts for formatting an SSIS Package by re-sizing and re-arranging Tasks/Transformations.
1. Go to Tools -> Options.
2. In the Options window, Expand Environment from the left navigation pane, select Keyboard.
3. Select Format.Autosize from the list of commands available and go to Press shortcut keys and Press Ctrl+F for Format, followed by Ctrl+A for Autosize and click on Assign to assign the shortcut for Format -> Autosize as shown below.
4. Now on the similar lines, select Format.Diagram from the list of commands available and go to Press shortcut keys and Press Ctrl+F for Format, followed by Ctrl+D for Diagram and click on Assign to assign the shortcut for Format -> Auto Layout -> Diagram as shown below.
Now to format the code in your SSIS designer window, just follow these simple steps:
- Select all the Tasks/Transformations in the designer (Ctrl + A).
- Press Ctrl+F followed by Ctrl+A to re-size (Autosize) all the Tasks/Transformations.
- Press Ctrl+F followed by Ctrl+D to re-align (Auto Layout -> Diagram) all the Tasks/Transformations.
There is no hard and fast rule that one should choose Ctrl+F & Ctrl+A for Autosize and Ctrl+F & Ctrl+D for Auto Layout -> Diagram. You may choose any other shortcut keys you are comfortable with by making sure the shortcut keys do not conflict with any of the existing shortcuts.