Posted on December 28, 2009, 3:26 pm, by Rhys, under
Powershell.
Chuck Boyce Jr (blog | twitter) recently commented on a limitation of the script from my post Discover SQL Servers with Powershell. The script does require that the SQLBrowser service is running for discovery to occur which may be a major issue for some. Here’s an alternative method that does not have this limitation. All [...]
Posted on December 26, 2009, 6:59 pm, by Rhys, under
Powershell,
SSIS.
SSIS and Powershell are two of my current loves in technology, so of course, I was excited to see someone has made a Powershell Script Task. I’ve been meaning to try this out for months. Unfortunately it looks like the project isn’t currently active, but I thought I’d still give it a whirl, and post [...]
Posted on December 18, 2009, 4:03 pm, by Rhys, under
Powershell.
Ashamed of the amount of time you spend on Twitter? Want to know how to automate Internet Explorer with Powershell? Once again Powershell comes to the rescue! Here’s an illustration I came up with to post tweets on your twitter account from a text file. Create a text file called tweets.txt and place it into [...]
Posted on December 6, 2009, 7:40 pm, by Rhys, under
SSIS.
I’m currently building a lot of SSIS packages that are primarily date driven. Many of these involve periods of 100 days, to several years, so I wanted to automate the testing of these packages. I’d previously automated the testing of stored procedures over date ranges but wanted a solution for testing the system as a [...]
Posted on November 21, 2009, 8:45 pm, by Rhys, under
SSIS.
Sadly, as people don’t make sense, we have to make compromises in our systems and processes. I recently had a requirement, in an SSIS package, to be able to identify which days were Bank Holidays and take a different course of action, e.g. not run the main process. Here’s an illustration of the approach I [...]
Posted on November 14, 2009, 2:24 pm, by Rhys, under
T-SQL.
This week I was tasked with testing a stored procedure that was meant to output data on certain days. This was over a 120 day period, so I wanted to find some automated way of doing this, rather than changing the server date manually for each execution. The method I came up with involves the [...]
Posted on November 10, 2009, 9:49 pm, by Rhys, under
T-SQL.
Sometimes, when working with extracts of data, it can be a pain to have to load these files into a database in order to work with them. It’s easy to use OPENROWSET to save yourself a little time. Here’s a basic example; ?View Code TSQLSELECT * FROM OPENROWSET (’MSDASQL’, ‘Driver={Microsoft Text Driver (*.txt; *.csv)}; DefaultDir=C:\Users\Rhys\Desktop\csv;Extended [...]
Posted on October 31, 2009, 1:40 pm, by Rhys, under
DBA,
MySQL,
T-SQL.
I’ve recently been busy documentation various systems at work and came up with these queries to get a list of databases and their sizes for each SQL Server. These queries will show the server name, database names, and their sizes in KB, MB and GB. For SQL Server 2005 & 2008 ?View Code TSQL– SQL [...]
Posted on October 28, 2009, 9:34 pm, by Rhys, under
Powershell.
Powershell is a pretty cool tool for many things including working with data. It’s just such a great time saver if you have to deal with multiple files or need to change them into different formats. Here’s how easy it is to turn a csv file into well-formed xml. ?View Code POWERSHELL# csv file to [...]
Posted on October 22, 2009, 1:34 pm, by Rhys, under
SSIS.
Here’s a quick VB.Net snippet that allows you to write messages to the Windows Event Log from your packages. Nothing to configure here, just change the log message to something appropriate. Obviously, in order to work, the package would have to be run under an account that has permission to write to the event log. [...]