Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Igor_V
Contributor
Contributor

Connection to a MSSQL database whose name contains "\"

I'm trying to create a database connection on an MSSQL server named SQLINTEG\SQLEDU.

The connection doesn't go through.

If there is no "\" in the server name, then everything is in order.

How correctly to configure a connection to such servers?

Labels (3)
1 Solution

Accepted Solutions
anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @Grapeus Grapeus​ 

 

I believe SQLINTEG refers to the server name while SQLEDU is the instance.

 

If that's the case and you're using open jTDS jdbc driver, you might succeed with the following approach:

 

jdbc:jtds:sqlserver://SQLEDU:1433/dbname;instance=SQLEDU

 

Where "instance=SQLEDU" should be informed on the "Additional parameters" attribute of the connection.

 

Now if you're using Microsoft JDBC driver, it should work with the following:

 

jdbc:sqlserver://SQLEDU\\SQLEDU;databaseName=dbname

 

Or perhaps with

 

jdbc:sqlserver://SQLEDU/SQLEDU:1433;DatabaseName=database

 

 

 

View solution in original post

6 Replies
anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @Grapeus Grapeus​ 

 

Did you try escaping the backward slash with another one?

 

Like this: "SQLINTEG\\SQLEDU"

Igor_V
Contributor
Contributor
Author

Yes, it doesn't work!

Safus
Creator
Creator

Hi @Grapeus Grapeus​ 

Did you try to escape like this within double brackets : "[SQLINTEG\\SQLEDU]" ?

Igor_V
Contributor
Contributor
Author

[SQLINTEG\\SQLEDU] also doesn't work

anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @Grapeus Grapeus​ 

 

I believe SQLINTEG refers to the server name while SQLEDU is the instance.

 

If that's the case and you're using open jTDS jdbc driver, you might succeed with the following approach:

 

jdbc:jtds:sqlserver://SQLEDU:1433/dbname;instance=SQLEDU

 

Where "instance=SQLEDU" should be informed on the "Additional parameters" attribute of the connection.

 

Now if you're using Microsoft JDBC driver, it should work with the following:

 

jdbc:sqlserver://SQLEDU\\SQLEDU;databaseName=dbname

 

Or perhaps with

 

jdbc:sqlserver://SQLEDU/SQLEDU:1433;DatabaseName=database

 

 

 

Igor_V
Contributor
Contributor
Author

Hi @anselmopeixoto (Customer)

Yes!!! It work!!! jTDS jdbc driver string correctly connected.

Thank you very much!!! It was a big problem for me!