All Articles max-conn-01-600x363

SQL SERVER – FIX: Could not connect because the maximum number of 1 user connections has already been reached

Sometimes making a change in something for which the impact is not known, could cause a heavy loss. A similar situation happened when one of my clients called me and told that he is in big trouble and losing a lot of money every minute. Without wasting any moment, I asked what is the issue, then he told that he changed some setting in SQL Server, restarted SQL and now no one is able to connect. The application is completely down! Let us see how we can fix the error: Could not connect because the maximum number of ‘1’ user connections has already been reached.

Read More
All Articles thought-400x400

SQL SERVER 2016 – Early Thoughts and Observations – Notes from the Field #120

[Note from Pinal]: In this episode of the Notes from the Field series database expert Mike Lawell explains about Live Query Statistics in SQL Server 2016. Statistics are heart of SQL Server. They play a very powerful role when SQL Server Engine needs help to build a new execution plan for a query. In earlier version of SQL Server we had the only privilege to see statistics after the query is executed. However, with the advancement of SQL Server 2016, the scenario has been changed. Here is a very interesting new feature of SQL Server 2016 which can help every performance tuning expert. Read the SQL Server 2016 – Early Thoughts and Observations of Mike in his own words.

Read More
All Articles bulk-logging-finding-01-600x400

SQL SERVER – Finding If Status of Bulk Logging Enabled or Not From Logs

Backup related questions are always challenging and sometimes our basics is shaken when someone randomly asks us something we were not aware of. Sometimes it takes a little bit of digging around in documentation and we are in for a surprise because this has been there for quite some time. In a recent conversation with a DBA friend of mine in a consulting exercise, he came back to me with an interesting question. Let us see in this blog post about how to find the status of Bulk Logging Enabled or not from SQL logs.

Pinal, how do I know if a Bulk Logging operation was performed on my SQL Server. I know there are a number of SSIS jobs that run during the day and night and I have a number of log backups that are taken continuously. Some of these jobs actually change the recovery model to Bulk-Logged and end of the process, they turn it back to Full once the script was to end. I know I can do a number of audit settings to make sure this is captured. But is there any other way to identify which of these logs when taken have the Bulk logged operation?

Read More
All Articles ADSI-01-600x400

SQL SERVER – How to Query Active Directory Data Using ADSI / LDAP Linked Server

There are situations when you need to integrate SQL Server with other product. Once of the classic example was seen during my last visit to a client. They wanted list of email addresses and phone numbers for all users in the company to be fetched by Active Directory. I have told them that SQL can read that data via linked server. Here are the steps to learn how to query active directory data.

Read More
All Articles multicoladd3-600x385

SQL SERVER – How to Add Multiple New Columns to Table with Default Values?

This is a follow up blog post of my earlier blog post on the same subject. You can read my earlier blog post over here. I recently received an email where a user asked how to add more than one new column to an existing table with a default value. Very interesting and simple question. Honestly, I love simple questions as they are the most needed by users. So here is the question – “How to Add Multiple New Columns to Table with Default Values?”. Now let us try to solve this question with the help of an example.

Read More
All Articles mysql-drop1-469x400

MySQL – How to Drop Table If Exists in Database?

In this post SQL Server – 2016 – T-SQL Enhancement “Drop if Exists” clause, we have seen the new feature introduced in SQL Server version 2016. One of my friends recently asked me question that how to drop table in exists in MySQL database? It was not surprising to see that not many people know about the existence of this feature. MySQL already has this feature for a while and if you are MySQL DBA, you may find it interesting that SQL Server just introduced this feature.

Read More
All Articles WI-Disabled-01-600x394

SQL SERVER – Patch Upgrade – Failed to connect to server. Error: 0x80070422

One of my recent interaction with a client was to assist in performing Upgrade the SQL Server 2008 R2 with service pack 2. As usual, I asked for setup logs from C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\ folder. There were multiple folders so I asked the one which corresponds to the time of failure. Let us see exposure how we can solve error Error: 0x80070422.

Read More
All Articles keep-calm-and-just-say-no-600x400

“I Don’t Know” – DBAs Should Learn to Use This Phrase – Notes from the Field #119

[Note from Pinal]: This is a 119th episode of Notes from the Field series. If you know Mike Walsh, he is an amazing person to meet and know. He is technical expert, but along with that he is a true life coach. I am fortunate to be his friend. Every single time I meet him, I learn something as a human. In this episode Mike explains one of the most important things any DBAs should learn, which is to say “I Don’t Know”.

In this episode of the Notes from the Field series database expert Mike Walsh gives a challenge to all of us. He explains to us why we should study our mistakes. He is indeed very right that every mistake gives us opportunity to correct ourselves.

Read More