SSIS Variables

Mark Broadbent has a few nuggets of information regarding using variables in SSIS script components:

Notice that in the example above the assumption is that the SSIS variable datatype is compatible with the script variable type.

Once you have finished writing your code block you may save your code and close the Script Editor. All that is left is to click the OK button to close the Script Task Editor and run your package!

Getting variables to work in script components isn’t terribly difficult, but Mark shows that there are quite a few steps to the process.

Multi-Script Using Object Explorer Details

Andrea Allred shows a nice trick using the Object Explorer Details window in SSMS:

One of the tips that I was super surprised that many people didn’t know is the Object Explorer Details. It allows you to delete multiple objects at once, script out multiple objects at once and just do some really cool stuff. How do I access this magic you are asking? When in management studio, click on View>>Object Explorer Details.

For those one-off jobs where you need to script out a dozen objects, this is very helpful.

 

Trigger Blue Screens

David Klee uses the registry to generate blue screens:

Voila! Use the USB keyboard registry key. Set it and reboot the machine. To trigger it, hold right-control and hit scroll lock twice.

BOOM! Immediate manually-initiated BSOD. Neat, huh?

Me, I just need to update my video card drivers; that gives me all the blue screens I want…

Find Duplicate Indexes In SSDT

Ed Elliott has another nice tool in his SSDT Dev Pack:

This new tool for the SSDT Dev Pack adds a menu item (Tools–>SSDT Dev Pack –> Find Duplicate Indexes) what it does is scan all the projects in the solution (it doesn’t follow “this database” references to examine them, maybe a future version) and then print to the output window a list of all the duplicate indexes based on the table, the columns and included columns – I don’t check anything else so you might actually want a duplicate in some circumstances but these should be very few and far between.

If you double click on the index it will take you to the location in the code where it actually is so you can delete it 🙂

A very useful tool gets even more useful.

SSPI Context

Sean McCown goes into fixing one example of the “Cannot Generate SSPI Context” error:

Now, this was just a quick tutorial on how to manage SPNs.  This hole can go pretty deep.  Here’s a decent link on MSDN for troubleshooting SPNs.  I don’t think I like their troubleshooting because they don’t really do a good job of showing you the commands, but it’s a good explanation of the problem, what an SPN is, etc.  If I remember correctly it’ll also help you choose the right SPN.

This is a classic example of a bad Microsoft error.  In this case, it’s bad because there are multiple root causes for the same error and because the message itself is unhelpful.

Test File Existence Using Powershell

Steve Jones shows us the Test-Path cmdlet:

One of the enhancements I wanted to make was check if the file exists, and if not, then download it. However, if it does exist, then I’ll skip the file. I know this means I don’t get updated files if schedules change, which is possible, but in that case, I can just delete the file from my desktop and go from there.

I made a quick search, and found a few links to the Test-Path cmdlet. Essentially you give this a file path and it returns true or false. Almost exactly what I need.

Test-Path is small but helpful, and a vital part of scripts which check files.

Categories

December 2015
MTWTFSS
« Nov Jan »
 123456
78910111213
14151617181920
21222324252627
28293031