Archive for May 2009

Auditing your SQL Servers with Powershell

Being able to know the setup and configuration of your SQL Servers is important for many IT Professionals. Powershell, combined with SMO, makes this task easy. SMO exposes a lot of properties allowing you to easily retrieve things like Processor & RAM Information, Service Pack Level, Operating System information, Collation Settings, number of Databases, and [...]

Auditing Network Adapters with Powershell

Those boring network auditing tasks you have to do are now going to be a breeze with Powershell. With technologies like WMI accessible from Powershell there is virtually no limit to what you can do. I’m going to publish a series of articles showing how Powershell can be used to document your server and network. [...]

Altering Database Objects with Powershell

Sometimes it’s necessary to rename tables and databases and this can create a lot of work if it’s referenced by other database objects. I recently came across this situation at work. Developers had introduced a second database into the system and each referenced the other. This didn’t sit well with our testing environment that had [...]

Monitoring & starting Services with Powershell

Are you part of the DBA crowd that hasn’t yet checked out Powershell? I’m really enthusiastic about its potential for server administration. Script out all those mundane jobs you have to do and make life easy. Here’s a Powershell script that makes checking if services are running, and optionally starting them, on multiple servers really [...]

Shrinking Tweets with Tweet-SQL

To get your point across on Twitter you sometimes have to try and shorten your tweets. This can be a pain for anyone over 30 who doesn’t know txtspk. Thankfully some clever chap has come to the rescue with TweetShrink and I’ve integrated it into Tweet-SQL. Here’s how you use it; ?View Code TSQLDECLARE @shrunk [...]

Temporary & Custom Database Object Naming

Over the years I’ve experienced various problems with temporary and custom database objects (as in objects created specifically for certain client systems). Development and deployment teams are often distinct and this can create issues. These issues have included; Temporary objects persisting for months or years beyond their initial purpose. Temporary objects spreading from development to [...]

Calculating datetime periods with T-SQL & MySQL

If you ever have to do any ETL type work then at some point you’re probably going to have to work with data on a daily batch basis. Many people make use of the DATEPART function in T-SQL, or the DATE function in MySQL for this type of work. If you do something like… TSQL [...]

Know who your friends are with Tweet-SQL

Tweet-SQL version 2 supports the new Twitter social graph API methods. These are two very simple methods to get all of your followers, or friends, Twitter user ids. There are four procedures in Tweet-SQL that support these methods. tweet_sog_followers – Returns the ids of the authenticating users followers or, if a non-null value is supplied [...]