problem connecting to MSSQL Server from Rider

I have a problem connecting to MSSQL Server from Rider.

Method 1 - with driver named Microsoft SQL Server (jTds)

In the Data Sources and Drivers window, when adding a Data Source, in the General tab, I chose default connection type and Microsoft SQL Server jTds driver.

In the `Host` field, I clicked the arrow and Rider found a host named `B-PC`. I think this is the right host, because it is the same host name I use in SSMS and in Visual Studio Code. At this stage, the `Url` field was autommatically updated to `jdbc:jtds:sqlserver://B-PC`

Then in the Instance field, I clicked the down arrow and Rider found two instances. I picked `SQLEXPRESS`. The `Url` field was autommatically updated to `jdbc:jtds:sqlserver://B-PC;instance=SQLEXPRESS`

Then in the Authentication, I chose `Windows credentials`, `Url` field was not updated.

Then in Database field I clicked down arrow, but there were no databases listed, so I entered the database manually, let's say `MyDatabase`. The `Url` field was updated to `jdbc:jtds:sqlserver://B-PC/MyDatabase;instance=SQLEXPRESS`.

After clicking the `Test Connection` I got error: `[08003] Server B-PC has no instance named SQLEXPRESS.`

I also tried to specify `localhost` instead of `B-PC`, but the error was the same.

Method 2 - with driver named Microsoft SQL Server (JetBrains)

At this point, I only changed the driver type and the `Url` changed autommatically to `Server=B-PC\SQLEXPRESS;Database=MyDatabase`

After clicking the `Test Connection` I got error: `Incorrect driver and/or database URL specified.` I also tried to change the url manually to include `;Trusted_Connection=True;TrustServerCertificate=True;` and/or to specify `localhost` instead of `B-PC` as the host name, but the error was the same.

Method 3 - with driver named Microsoft SQL Server (Microsoft)

After changing the driver type to Microsoft, the url was changed to: `jdbc:sqlserver://B-PC\SQLEXPRESS;database=MyDatabase`

When testing the connection, I got error: `[08S01] The server sqlexpress is not configured to listen with TCP/IP.`

I am not sure whether this is the right error, because I use this SQLEXPRESS instance in bot SSMS and VS Code without problems.

Question

How to connect to SQL Express installed locally on Windows PC using Windows Authentication?

P.S. I also have a login with password in the SQLEXPRESS and I tried all 3 methods with user/password settings, but the errors remained the same respectively as with Windows authentication.

0
1 comment
Hi,

Please ensure you have selected Microsoft SQL Server LocalDB as your data source and followed the steps above:

https://www.jetbrains.com/help/datagrip/connecting-to-sql-server-express-localdb.html

If this doesn't work, please include the idea log from Help - Show Log in Files and upload it onto our FTP https://uploads.jetbrains.com/

Include the upload id in your reply
0

Please sign in to leave a comment.