Troubleshooting SQL Server Errors - A Comprehensive Guide
Tags: sqlserver, mssql, datascience, sqlerrors
Published: 2023-08-25 14:48:22


## **Introduction:**

Experiencing errors while setting up the SQL Server Management Studio?

I understand the mix of frustration and urgency that accompanies these issues as I have been there before. You've taken the proactive step of seeking a solution, and I want to assure you that you're in the right place.

In this article. I will provide step-by-step solutions to help users overcome these challenges and ensure a smoother database experience.


```
Table Of Content

1. Setting up SQL Server studio
2. Network-related or Instance-specific Error
- Cause 1: Connecting with the wrong instance Name
- Cause 2: SQL Server service instance is not running
- Cause 3: SQL Server browser is disabled
- Cause 4: TCP/IP of your server instance is disabled
3. Microsoft OLEDB Error
4. Culture is not supported Error
```

### **Prerequisites**

This article is for anyone who is just starting in SQL, Intermediate SQL users as well as experienced SQL users.

## **1.Setting Up SQL Server Studio**

To set up SQL Studio, you need to download 2 things:

 - SQL server.  Download it through the link: [SQL Server Downloads | Microsoft](https://www.microsoft.com/en-us/sql-server/sql-server-downloads). Make sure to download the Express version and then install it. In the prompt that appears select Basic and then complete the installation.
 - SQL Server Management Studio(SSMS). Download it through the link: [Download SQL Server Management Studio (SSMS)](https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver15). Install once the download is completed.

To connect to the server, open the SQL Server Management Studio(SSMS).

1. Click on Connect - Choose database engine. A pop-up appears.
2. Hit the dropdown for the server name -  hit the "browse" option - click the + sign next to “database engine” -  select the  “computer name\SQLEXPRESS” - Click OK.
3. Before hitting connect, select the options button and make sure "Trust server certificate" is checked off near the bottom. If you don’t check the trust server certificate you will get an error like this:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oq8qyvrtjsvx3sau1bxc.PNG)

> A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) (Microsoft SQL Server, Error: -2146893019)

> The certificate chain was issued by an authority that is not trusted



## **2.Network-related Or Instance-specific Error**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z4w0yx2xfpu9e45rmqp3.PNG)

> A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

**CAUSES**

The following can be the cause of this error:
1. Connecting with the wrong instance Name
2. SQL Server service instance is not running
3. SQL Server browser is disabled
4. TCP/IP of your server instance is disabled

**CAUSE 1: Connecting with the wrong instance name**

**SOLUTION:**

Check that you have specified the correct server name and instance name (if connecting to a named instance) in your connection string.

**Get the instance name from Configuration Manager**
On the server that hosts the SQL Server instance, use [SQL Server Configuration Manager](https://learn.microsoft.com/en-us/sql/relational-databases/sql-server-configuration-manager) to verify the instance name:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/en1kbg98v1p0lpomkezm.PNG)

1. Start SQL Server Configuration Manager
2. In the left pane, select SQL Server Services.
3. Click on services, and verify the name of the instance of the database engine.

> -  SQL SERVER (MSSQLSERVER) indicates a default instance of SQL Server. The name of the default instance is <computer name>.
> -  SQL SERVER (<instance name>) indicates a named instance of SQL Server. The name of the named instance is <computer name>\<instance name>.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2gswxlpm9248y46gzag0.PNG)


**CAUSE 2: SQL Server service instance is not running**

**SOLUTION:**

To start SQL Service
1. Start SQL Server Configuration Manager.
2. In the left pane, select SQL Server Services.
3. In the right pan select SQL Server(SQLSERVER) or SQL Server(SQLEXPRESS)
4. Then click the start service triangular button
5. The service has been started

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmr2wu31rq0h1npmbswe.PNG)

**CAUSE 3: SQL Server browser is disabled**

For named instances, the SQL Server Browser service is required to provide the port number to connect. Ensure this service is started.

**SOLUTION:**

To start the SQL Server browser
- Start SQL Server Configuration Manager.
- In the left pane, select SQL Server Services
- In the right pane double-click on SQL Server Browser - click on Services - click on the drop-down arrow - click on Automatic - click on Apply.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/twpb33s3xrf2p2u99alv.PNG)

- Select  “Log On” -  click on “Start” - Click on Ok
- The service has been started


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lb4t9efhl4siv2x06aqj.PNG)

**CAUSE 4: TCP/IP of your server instance is disabled**

**SOLUTION:**

To  enable the TCP/IP
1. Start SQL Server Configuration Manager.
2. In the left pane, Click on the drop-down arrow by “SQL Server Network Configuration”.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckb7flw7i0ss3smpdejh.PNG)

## **3.Microsoft OLEDB Error**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/waux07gaszdyef87biwa.PNG)

> "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine"

This happens when you are trying to import your Excel file into your SQL Server.

To fix this error, download the Microsoft Access Database Engine 2016 Redistributable and install it in your system.

Click on this link to download the Access Database Engine Setup: [Download Microsoft Access Database Engine 2016 Redistributable](https://www.microsoft.com/en-us/download/details.aspx?id=54920)

NOTE: You are to download the 32-bit version even though you run a 64-bit Machine.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ofksvepbs1ad7p3b2lcx.PNG)

If you already had the 64bit installed you will run into this type of error when attempting to install the 32bit version.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c3k1bcra8rbz9zvsh7ey.PNG)

If you run into this error, close and abort the process.

We will install the setup quietly using cmd.

To open your cmd, click on Windows key + R. Type in “cmd” and click OK.

This will automatically open the command line interface

To run the setup quietly follow these steps:

- Cd to the directory where you downloaded the setup. To get the directory, Right-click on the downloaded file - Click on properties - Copy the location details.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gi1683j1im0ckkkgd97o.PNG)

- Type the name of the setup file including the extension .exe
- Add a space + "/quiet" to bypass the error and get the 32-bit version installed.

```
accessdatabaseengine.exe /quiet
```


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/unidpgaxp85pyjrdfr6w.PNG)

- Click enter and wait for some time for installation to be complete.
- Close your SQL Server Studio to enable it to pick up the new update.
- Open your SQL server and connect.

## **4.Culture Is Not Supported Error**
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4pbl1sxlpv0w2uc8e13w.PNG)

> An error occurred during local report processing Culture is not supported Parameter name: culture 3072 (0x0c00) is invalid culture identifier.

To fix the “culture is not supported” error while importing your Excel file do this:

Go to control panel - Clock and Region - format and change to “English (United States)

This will fix the error.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3gzz90roqyonrrtzyklz.PNG)

## **Conclusion:**

In this article, we covered three common types of SQL Server Errors:

1. Network-related or Instance-specific Error
2. Microsoft OLEDB Error
3. Culture is not supported Error

By following the step-by-step solutions provided, you'll be better equipped to address these errors and maintain a smooth and efficient database experience. Remember, troubleshooting requires patience and careful attention to detail, and with practice, you'll become adept at resolving OLE DB errors and ensuring the reliability of your database interactions.