SQL SERVER – Writing Your First Subquery From a Single Table

My primary responsibility is to help different organizations with tuning their SQL Server Performance and here is the link to my most popular service SQL Server Performance Health Check. I often encounter complicated performance problems which are not easy to resolve, however, recently during the lunch break, I was asked by Junior developer a question about writing a subquery from a single table by a Junior DBA at the organizations.

Read More

SQL SERVER – Information Message: Cannot shrink file in database to xxxx pages as it only contains yyyy pages.

I often get emails from my blog readers asking various types of clarifications about my own blog. Here is one of the interesting questions from a reader about message Cannot shrink file in the database to xxxx pages as it only contains yyyy pages which he encountered after following my below blog.

Read More

SQL SERVER – Error 21028 : Replication Components are not Installed on This Server

One of my clients, for whom I installed SQL Server and configured AlwaysOn came back to me with an error message. While trying to configure replication they were getting an error message. In this blog, we would learn how to fix error “Microsoft SQL Server Management Studio is unable to access replication components because replication is not installed on this instance of SQL Server”

Read More

How to Create an Empty Table and Fool Optimizer to Believe It Contains Data? – Interview Question of the Week #204

Question: How to Create an Empty Table and Fool Optimizer to Believe It Contains Data?

Answer: Before I answer this question, I must acknowledge that I have never heard this question in my 20 years career before and I must ask you back, where do you come up with these kinds of questions.

Read More

SQL SERVER – Fix : Error Msg 1813, Level 16, State 2, Line 1 Could not open new database databasename. CREATE DATABASE is aborted

It is indeed a pleasure when we write a timeless article for SQL Server and DBAs read it after many years. In the year 2007, I wrote an article about an error related to Could not open a new database. It has been one of the top viewed blog posts all the time. Recently SQL Server Expert Jeremy Roe has sent me an updated script for a recent version of SQL Server for the same error.

Read More