Calendar Table? Yes please!

I finally got sick of not having a calendar table, so I went ahead and made one today. It’s nothing special and it really didn’t take much time, but I thought I would go ahead and share my script in the hopes that google will index it and somebody won’t have to think about it:…
Read More

Retrieve the top X random rows from a query

Let’s suppose for a minute that you want to retrieve the top x number of rows from any given query. Keep in mind that x is a value that your users can supply. Sure, you could do string concatenation and EXEC sp_executesql ‘SELECT TOP ‘ + @count + ‘ x FROM y;’. But, then again,…
Read More

Links for the Week of 2009-01-23

SQL SERVER Top 10 Interview Questions to Ask Senior DBAs Brent Ozar poses some great questions to ask DBAs (and that you might be asked as a DBA) during an interview. These are the good kind of interview questions, not the “how would you do XYZ” kind of questions. (My default response to the XYZ…
Read More

Flexible Database-Level Roles

This is following up from my previous post on Database Roles. In my previous post, I talked about fixed database roles. If you’ve forgotten, go back and re-read the article. I’ll still be here when you get back. So, what exactly are flexible database roles? They are roles that you create in the database. It’s…
Read More

Links for the Week of 2009-01-16

SQL SERVER Re-associate SQL Users with Logins Scott Koon put up this script a while ago (back in ’07), but I had cause to use it this week. When you restore a database from a backup taken on a different machine you’ll need to re-associate users with their logins. Easy. Done. Scripting Server Permissions And…
Read More

How I Get By Without sysadmin

The people who follow me on twitter have probably noticed that when I’m not tweeting absolute nonsense, I’m tweeting about performance tuning SQL. What most people don’t know is that I don’t have sysadmin access on our servers, nor do I have any of the other permissions that would let me collect trace information or…
Read More

Links for the Week of 2009-01-30

SQL SERVER Set based random numbers George Mastros points out that generating a random number using RAND() in a set-based operation will always return the same value for every row in the result set. What’s a DBA to do? Luckily, George also covers a great way to get around this predicament. Hardware for SQL Server…
Read More

Links for the week of 2009-01-09

SQL SERVER The first pillar – A Coherent Design Louis Davidson has started to go in depth into his pillars of database design. Louis clearly explains what a coherent database design is and why it’s important. sp_indexinfo – enhanced index information procedure Tibor Karaszi has put together a custom stored procedure to provide additional information…
Read More

Goals for 2009

Since it’s the new year, and I feel like being a lemming and going along with everyone else in the blogosphere, here are my goals for 2009: Learn the SQL Server BI stack. At first read this is a lofty goal. However, I don’t plan to learn and master the entire BI stack in SQL…
Read More
Menu