In the real world, everyone knows that if you divide by zero a wormhole will open up and swallow the universe. In SQL Server, it’s not good, but it’s not nearly as dramatic. I encountered the following error this week and thought it would make a good topic: Msg 8134, Level 16, State 1, Line … Continue reading Handling Divide By Zero Error
I recently came across a scenario where an application process was not performing correctly on one database but was working fine on others. The process should have been completing in seconds but was taking minutes with no indication of activity. After some investigation, I found that the process was stuck waiting on a SELECT statement … Continue reading Do You Really Need that Order By?
Searching for a value or group of values with a wildcard is more than just putting a % on both sides of a text string. If you know you’re looking for all strings in a name field that start with the name “Chad” then you are you really shooting yourself in the foot by using … Continue reading Utilizing Indexes When Search Text Begins with a Wildcard
There are a lot actions you can take that do more harm than good in SQL Server (did somebody say shrinking your database files every day?) that don’t get the same attention. Still, SELECT * can cause headaches and we’re going to take a look at some of those headaches today. If you’re investigating a … Continue reading Break the Habit of SELECT *
The latest topic for T-SQL Tuesday comes from Mikey Bronowski. This month is all about the most helpful and effective tools we’re familiar with. More info for the T-SQL Tuesday post can be found below: Just Do It The main tool that I use every day is one I couldn’t live without: Todoist. For work … Continue reading T-SQL Tuesday #135: Tools of the Trade
Projecting growth can be hard. Initially, it may seem like using INT for something like an identity column will be enough to last forever. I remember getting our first or second PC in the 1990s and being told “this hard drive is so big you’ll be set for life!” Pretty sure that was around 1 … Continue reading Running Out of INT Identity Values
Today is Groundhog Day in North America which means we can plan out our weather for the next six weeks. If the groundhog comes out and sees its shadow we’ll have six more weeks of winter but if not we’ll have an early spring. While some people say there’s some science behind it, the whole … Continue reading Generating Random Numbers in SQL
You know it’s going to be a fun week when it starts out with an error you’ve never seen before while performing a task that seems about as simple as can be. All I need to do is create a database? A tool that restores a model type database and does a bit of configuration … Continue reading Missing SQL Failover Cluster Dependency
I want to talk about a setting that you should usually never touch besides verifying it’s at the Microsoft recommended value. Then, I’ll tell you about why I touched it anyway. Sometimes that red button is too shiny. Our story begins on a test server hosting a couple hundred databases. Over time, the server kept … Continue reading A Threadpool Story
Dealing with time zones in general can be a headache. Thankfully, SQL Server 2016 included a new clause to make working with time zones more manageable. Let’s look at a couple examples: I’m in Eastern Standard Time so we’ll start here. Keep in mind that when no offset information is included, SQL Server is going … Continue reading AT TIME ZONE Is On Your Side
Something went wrong. Please refresh the page and/or try again.
Follow My Blog
Get new content delivered directly to your inbox.