Starting in SQL Server 2012 and in Azure SQL Database, Microsoft introduced the concept of a contained database. A contained database is a database that is completely un-reliant on the instance of SQL Server that hosts the database including the master database–theoretically this makes a database much easier to move between servers (you’ll note the absence of SQL Agent jobs from this post, that’s a difference problem.). One of the biggest benefit is that it allows database level authentication, so there no need to have user logins on server level. Contained database now enables us to make a database more portable. I can backup and restore to any instance of…
-
-
July 1st is a day all Microsoft Most Valuable Professionals (MVP) wait patiently at their computers hitting F5 over and over again waiting to find out if they have been renewed for the upcoming year. I am proud to announce that Denny Cherry and Associates once again have FOUR MVP’s on staff. Denny, Monica and Joey have all been renewed for 2018. John, being newer to the program, will not be up for renewal until the 2019 award cycle. Combine we have over 17 years of MVP program experience. Big mile stones were hit by both Denny and Joey. Denny was awarded his 10th and Joey reached his 5th.…
-
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 applies to Change Data Capture) they had setup which included…
-
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 the community that we have all been beginners once and none…
-
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 not cost effective for them. Microsoft recognizes this and has…
-
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 estimations caused by stale or missing statistics (or even data…
-
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 and Join Predicates. Filtered Predicates cover your WHERE or HAVING…
-
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 plan that fulfills a query request. You will note that…
-
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 other hand, it’s a really great way to see how…
-
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 lunch or even just sit and watch it streamed to…




















