Replication Max Text Length

Ever seen the below error? Until this week I hadn’t. So, I figured I’d take a little time and introduce it to those that had not. Error Description: Length of LOB data (65754) to be replicated exceeds configured maximum 65536. Use the stored procedure sp_configure to increase the configured maximum value for max text repl size option, which defaults to 65536. A configured value of -1 indicates no limit We ran into an issue with a customer this week, this error was flooding the error log. After a little digging I found it had to do with transactional replication (also… Continue Reading

Respectfully Responding

I typically don’t write opinion posts, but given recent events I thought it was important to follow up on one of my tweets. Last week, I tweeted about  Stack Exchange and my thoughts on the lack of respect in the responses to those who take the time ask questions in forums. I had many people ask as to what I was referring to specifically, including some Microsoft employees. My response was (and still is) that I don’t believe in mob reactions or smearing anyone’s name and chose not to reveal the details. My reason for posting that tweet was just to remind those in… Continue Reading

How to get started with Always Encrypted for Beginners Part 4: Change is Coming

A few weeks ago, I wrote Part 1, 2 and 3 of this series, which was a beginner’s guide to Always Encrypted. In part 4, I am going to talk about the changes that are coming in vNext of SQL Server. As I discussed in part 3 there are many roads blocks the can stop the implementation of Always Encrypted (AE). In the current available versions of SQL Server 2016 and 2017, along with Azure SQL Database, the cost of using AE was way too high for many companies. There are so many code changes needed to implement AE that moving to it is… Continue Reading

Importance of Statistics in SQL Server

Following up on my last post about the Cardinality Estimator let’s talk about column statistics and how they work and play a part in execution plans. The cardinality estimator relies heavily on statistics to get the answer to selectivity (the ratio of distinct values to the total number of values) questions and calculate a cost estimate. This hopefully gives us the best possible execution plans for queries.  In this post, I will show you where to find information about what your statistics contain and information regarding each of those fields. Then we will look at the impact of over and under… Continue Reading

Query Predicates in SQL Server

Sometimes people speak “SQL” and expect you know all the terminology. In recent a conversation about query plans I was ranting on and on about how the predicates were written when the person stopped me and asked a very simple question. Like a light bulb going off, it reminded me that not everyone knows what the other person is talking about when terminology is mentioned without clarification. So, this post will answer that persons very valid simple question. What is a SQL Predicate? Predicates are expressions that evaluate to TRUE, FALSE, UNKNOWN. There are two types of predicates Filtered Predicates… Continue Reading

5 Ways to Examine Cardinality Metrics

In SQL Server the query optimizer uses a cardinality estimator to answer data SELECTIVITY questions like the ones below. The optimizer uses this cardinality data, which relies heavy on statistics to get the answers and calculate a cost estimate. It takes the #of Rows to Satisfy a Predicate/Total # of Input Rows. How many rows will satisfy a single filter predicate? Multiple? WHERE How many rows will satisfy a join predicate between two tables? JOIN How many distinct values do we expect from a specific column? DISTINCT GROUP BY From this estimate the optimizer is able to find an efficient execution… 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

Free Training 24HOP

In my sessions, I always talk about how to build your skill set when you don’t have a budget for training. Well next week April 25-26 is one of those free opportunities I take advantage of each year. 24 hours of PASS, affectionately referred to as 24HOP, is an online training event comprised of 24 sessions in a day free training. Register here http://www.pass.org/24hours/2018/april/About.aspx One technical session is given every hour around the clock, so no matter what time zone you are in you can easily catch a session or two. It makes it easy to stream during work, during… 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

SQL Server Updates Tricked Me for Years

When applying a new SQL Server cumulative update, hot fix, or upgrade SQL Server doesn’t always apply all the fixes in the patch. When you upgrade the database engine in-place, databases you had already stay at their pre-upgrade compatibility level, which means they run under the older set of optimizer rules. Additionally, many optimizer fixes are not turned on. The reason for this is that while they may improve overall query performance, they may have negative impact to some queries. Microsoft actively avoids making breaking changes to its software. To avoid any negative performance impacts, Microsoft has hidden optimizer fixes… Continue Reading