SQLStudies
Archives: August 2013
The most important skill to practice when preparing for any certification exam!
I like practice tests. Once I feel like I’m getting ready to take a certification exam I start taking an appropriate practice exam or two.
Just a point here. When I get a question wrong I review the SUBJECT I get wrong, I don’t just memorize that particular answer. I… Read more
4 comments, 903 reads
Posted in SQLStudies on 28 August 2013
The effect of VLF size on shrinking the log.
I was wondering the other day how VLF (Virtual Log File) sizes effected shrinking the log file so I decided to do a bit of experimentation.
Note: If you aren’t familiar with VLFs you might read David Levy’s A Busy/Accidental DBA’s Guide to Managing VLFs.
First we create a… Read more
3 comments, 2,448 reads
Posted in SQLStudies on 26 August 2013
Lots of ways to UNPIVOT a table
I recently read an awesome post on http://www.stackexchange.com questioning how to change columns to rows ie UNPIVOT. One answer demonstrated 4 different ways to unpivot a table including your basic UNPIVOT statement, CROSS APPLY, CROSS APPLY with VALUES and a dynamic SQL version for when you have a large number… Read more
0 comments, 1,183 reads
Posted in SQLStudies on 21 August 2013
sp_SrvPermissions
Last week I posted my stored procedure for database permissions, sp_DBPermissions. A couple of days later I was demonstrating it to one of my co-workers and his response was “Where’s the server version?” Unable to come up with an appropriate rude response I’m posting the server version this week,… Read more
0 comments, 874 reads
Posted in SQLStudies on 19 August 2013
sp_DBPermissions
Last week I posted a series of database permissions scripts. I’ve been using them quite a bit over the last week and decided they were too unwieldy the way they were. I had to copy over each script, put in each parameter and then run it. Not all that much… Read more
3 comments, 796 reads
Posted in SQLStudies on 14 August 2013
“My transaction log is too big!”
“My transaction log is too big!” I wish I had a dime for each time phrase has been spoke, written, tweeted, etc. I’ve read about it in various forums, blog posts etc. Discussed it with co-workers and other DBAs I know. I know it’s not, but sometimes it feels like… Read more
4 comments, 1,567 reads
Posted in SQLStudies on 12 August 2013
How are COALESCE and ISNULL different?
At first glance these two functions seem very similar, and superficially they are. For example COALESCE(fieldname1, fieldname2) and ISNULL(fieldname1, fieldname2) return seemingly identical results. The big obvious difference is that ISNULL can only have two parameters while COALESCE can have n parameters.
So what are some of the more subtle… Read more
6 comments, 6,928 reads
Posted in SQLStudies on 7 August 2013
Database Permissions Queries
Over the last year of blogging my thoughts and queries I’ve discovered something interesting. I posted Where is my Backup? and found myself referring back to it over and over again. And that’s just one example. Turns out that for queries I tend to use frequently posting them here is… Read more
3 comments, 1,230 reads
Posted in SQLStudies on 5 August 2013