Rotating Header Image

Posts Tagged ‘TSQL’

I am not the first DBA to take up this cause… but I am determined to be the last

OK maybe this article is not THAT important LOL but it was a great quote by Obama so I figured I’d work it in LOL Please know what Recovery Mode your databases are in and your recovery requirements and then back them up accordingly. Too often I see databases that are in a Full or [...]

When you want the MAX row that’s NOT the MAX row

Yeah me too LOL… let me break it down for you… If the data was in a race and the MAX row is considered the Gold Medal… the user wants the Silver Medalist. So because sysobjects exists for every database my use-case will work with that table cause then I don’t have to worry about [...]

Check SQL Server Agent status on all SQL Servers

Every company I’ve worked at had some type of standard schedule to apply (non critical) Windows patching.  Most (if not all) of the time this ends up requiring a reboot of the whole environment which no matter how good your shutdown/startup documentation is tends to be a worrysome time. If you haven’t played around with SQL [...]

Finding the database owner using TSQL #SQL

As part of a cleanup initiative we have been reviewing all of our databases and their owners and looking for databases that needed their owner changed. We only wanted to touch the databases where the current owner did not equal the owner we wanted to use. I had to stop and think for a minute [...]

Leading Zer0000000000s

So I got an email question asking for a way to pad a column with leading zeros into a 10 digit text/number (the person had an Oracle background and was cursing at the lack of LPAD in SQL Server). There are a few different ways to solve this problem so we're going to look at [...]

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.