Possible Infinite Recompile Was Detected for SQLHANDLE

On one of my SQL Server instances, I see a lot of these infinite recompile messages in the SQL log. Sounds bad, but they never lined up with any detected errors or failures, and I always seemed to have more important things to focus on so I let it slide. Well, today was a slow day — being the Friday before a holiday weekend — so I decided to investigate. The error messages, error #2814, all look like the below:
read more

Return Max or Min Value of a Group of Columns as a Single Column

Recently, I needed a query to identify tables that developers had create as point-in-time backups of tables that were never used again (turns out, there’s quite a lot of them in this database). They are characterized by having _bak or _ appended to the end of them. I wanted to provide a list of the tables to the development team and give them the opportunity to say that any of the tables should not be deleted. I wanted to provide,
read more

What is the max/min size of a decimal data type?

Recently, I wrote a maintenance script to check every table in every database on our servers at work nightly and email a report of identity columns that are approaching the limits of their data type. The minimum and maximum values for most numerical data types are documented in Books online, but for decimal/numeric data types it is not documented and varies based on the values provided for the precision and scale. Most people know that precision is the total number
read more

T-SQL Tuesday #74: Be the Change Round-up

Thanks to everybody that participated in this month’s T-SQL Tuesday. A big thanks to everyone who wrote a participating blog post, and a really huge thanks to everyone who read the posts shared by this month’s participants. If you follow one of the links on this round-up page, I will kindly ask that you leave a comment on a blog post that you read if it teaches you something, gives you a new perspective, or makes you think. A blog
read more

T-SQL Tuesday #74: Ch-ch-changes

Welcome to my contribution for T-SQL Tuesday 74 being hosted by me. So special thanks to me for hosting it. Good job me, I’ll buy me a beer next time I see me to thank me properly. But enough about me, my post is about using Query Store in SQL Server 2016 to identify queries or plans that have changed. Visit the blog party page to take part in this month’s T-SQL Tuesday event or to read other blog posts
read more

T-SQL Tuesday #65 – Overcoming Variable Limitations in SQLCmd Mode

It’s time again for that T-SQL blog party T-SQL Tuesday, and this month’s host is Mike Donnelly (blog|@SQLMD). If you want to join in the blog party, take a look at Mike’s announcement for an explanation of the topic and rules for participating: T-SQL Tuesday #065 – Teach Something New. My contribution this week is about overcoming the variable limitations of SQLCmd mode. Most people know what SQLCmd is, the command line SQL client utility for running T-SQL, or perhaps
read more

Why is Your SQL Server Slow? All-for-one and One-for-all

I have one more thing I want to talk about regarding the conversation I had recently with my friends and former colleagues at Idera about the things that slow down SQL Server. Another “quick performance wins” you can take advantage of is segregating the types of files SQL Server uses. If you install SQL Server by just clicking NEXT until you get to the end, you end up with everything running on the same drive. Different files have different types
read more

Why is Your SQL Server Slow? Here's a Hint

I was talking recently with my friends and former colleagues at Idera about the things that slow down SQL Server. Specifically, the discussion was about things that people could change without a lot of trouble to make their SQL Server run faster. I like to use the phrase “quick performance wins” for these easy-to-fix issues that can generate a considerable performance boost. This conversation led to a whitepaper on 5 things that are making your SQL Servers slow. Watch Idera’s
read more

T-SQL Tuesday #49: Wait For It Roundup

A huge round of applause and my thanks to all of the participants and spectators for this month’s edition of T-SQL Tuesday. I hope I didn’t keep you waiting too long for the roundup. <rimshot> Let’s take a look at this month’s participating blog posts: Fellow Certified Master (MCM) Rob Farley (blog|@rob_farley) led off with Waiting, waiting…. Rob talks about what causes SQL Server (and computers in general) to be slow and how to baseline SQL Server waits to detect
read more

T-SQL Tuesday #49: My Go-To Query For Waiting Tasks

I’m not just hosting T-SQL Tuesday, I’m a customer as well. Err, I mean participant. Topic for this month’s T-SQL Tuesday, hosted by yours truly, is … wait for it … Waits and Queues. For my donation to this little blog party, I’m contributing my favorite go-to query for waiting tasks. Do you ever get complaints that SQL Server is “slow”? Yeah, that’s a helpful report, right? when I get those kinds of reports, I like to take a quick
read more