Blog Archives

T-SQL Tuesday #46: You did what? Creative hacks to common problems


This whole thing, was put in a store procedure and then called from a job step for a long running job. For example, like a database backup job. And additional logic was written around the return value to write proper error numbers to application log. These event-ids where then picked up by monitoring applications and alerts where raised.

I have mixed feelings about this solution. Although, it worked without a problem (I am secretly proud that I was able to write something like this); I would have loved to just upgrade the servers to SQL 2008 and be done with it.

Tagged with: , , , , ,
Posted in SQL Server

Shuffle the deck using PowerShell


Generate a random permutation of a given set of elements. Power-shell implementation of the ‘Fisher-Yates Shuffle’.

Tagged with: , , , , ,
Posted in Fun-Stuff, PowerShell

Adding Extended Properties to SQL*Server Databases Using PowerShell


When you are working as part of a team that manages a few hundred SQL*Server instances; sometimes, it becomes hard to keep track of all the people who need to be notified when you plan for database migrations and such. Also, if there is an issue that needs their input ($’s); we do not want to send it to the wrong person now, would we. Maintaining the information in excel sheets is good but, wouldn’t it be nice to have the information available on the DB itself? We can get all the information in one shot and send out e-mails to the concerned (correct) individuals.

Tagged with: , , , ,
Posted in PowerShell, SQL Server