SQL Server Statistics Health Reminder

I’ve written about statistics in SQL Server a few times now. Through conversations  I am reminded that not everyone keeps their table statistics up to date. Keeping your statistics up to date is one of the more critical components of SQL Server performance issues. Please be sure you are doing more than just index maintenance to maintain your statistics.  Index maintenance  only maintains statistics created by indexes and single field predicate created table statistics. There are also column statistics that need to be maintained that are created by predicates usage in your queries or even manually created. For each insert,… Continue Reading

Filtered Index Basics

In this post, we continue with another beginner’s blog of database features that may be unknown to many. Let’s take a look at filtered indexes. Many database administrators are fully aware of the power of indexes and know how to create them. However, I find that some have yet to dive into fully optimizing their indexes and taking advantage of what filtered indexes has to offer. What is a filtered index? Simply it’s an index with a where clause. It is an optimized non clustered index that can be narrowed down in scope to better fit a subset of data.… Continue Reading

DMV’s for the Beginner

I give performance presentations at many different events to all levels of SQL Server professionals. Over time I’ve noticed that some DBAs and developers have never looked at the dynamic management views (dmv’s)  that are available within SQL Server starting with SQL Server 2005. These DMVs are useful means to determine what is going on with a particular SQL Server instance. So, in this post I am going to list a few of my very favorite DMVs as a reference for those who may be new to them. Performance Tuning These dynamic management views are what I use first when… Continue Reading

Scheduling things to Run in SQL Server

A key part of the SQL Server Agent is the ability to schedule jobs. While you can create one schedule for each agent job, frequently with applications like Reporting Services, users use Shared Schedules across multiple jobs. For instance, you can set a schedule to run at 8 am on week days or run every 2 hours or pick from a predefined list of schedules that already exist in the MSDB database. These are very convenient. However, if you choose to use these be sure you are keeping track of what is running for each of these shared schedules. You… Continue Reading

Live, Learn, and Grow

Ever look back at old work and wonder what was I thinking when I did that? Or even better you mock and get disgusted over some code you stumble upon and then realize you wrote it? Today is one of those days. Lucky for me one of my clients is a company I used to work for. It’s awesome to be able to go back and work in an environment you are familiar with. However, with that, you realize when you worked there you made some decisions or wrote some code that you now shake your head at. On the… Continue Reading

Template Explorer Gold Mine in SQL Server Management Studio

Sometimes as a newbie to SQL Server using SQL Server Management Studio (SSMS) you don’t know about the little gold mines that are within the product that help you be a better DBA or Developer. Template Explorer is one of those. To get to it go to VIEW from the taskbar then Template Explorer. Alternatively, you can reach it with keyboard shortcut Control+Alt+T. When you click on it, another side window will appear showing you a list of all templates available within Management Studio. A basic example would be creating a new stored procedure, this template provides an easy starting… Continue Reading

Do Not Pass GO!

What is the GO statement and why is it so important to use? When do I have to use it? When do I not use it? These are questions that have passed through my head from time to time while writing T-SQL within SQL Server. First What Is It and When Should I Use It?   The GO statement lets SSMS (the interface) know when it’s the end of the batch. It basically defines the scope of what you are trying to send to the Database Engine. The below example sends two separate statements. The first statement changes the database context to… Continue Reading

Quick Model Database Tidbit

Are you using your Model Database to its full potential? I am finding more and more that Database Admins are not using the Model database to its fullest potential and some not at all. What is that Model Database for? The model database is basically the default setup (template) for all other databases created on a SQL Server instance. All databases created after install will inherit the properties of this database. Why Configure It? Using the model can insure consistency within your environment and is a quick way to automate your database setups. Below is a list of things I’ve… Continue Reading

SQL Sequence vs Identity Column

Let’s take a look at what a Sequence is in relation to an Identity Column in SQL Server. Did you know Sequence even existed? I didn’t until I was asked about them. It’s amazing how much you can skip over and never notice in SSMS. See this little folder, ever notice it under Programmability in Management Studio. Yep it’s there, SQL Server has this very handy thing called Sequences. Sequences are a relatively new feature that have only existed since SQL Server 2012, but have long existed in Oracle (where there a no identity columns). What is a Sequence? Per MSDN,… Continue Reading

Just Check ALL the Boxes – SQL Server Installs

Today I ran into something on a client server I unfortunately see too often.  The DBA goes through the trouble of configuring and setting up alerts\operators but doesn’t really understand what the options in the configurations mean. So unfortunately, that means they take the CYA (cover your ass) approach and they check all of them. Now, not only have I seen this with alerts but also with things like security configurations as well. My advice is to always in to take a second and research what each option is before you check the little boxes, especially when it comes to… Continue Reading