Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect LINQPad to remote SQL Server

Disclaimer: I understand the question is very basic, but I could not find the answer in Google or here, and can not do it myself with guessed configuration.

I want to get started with LINQPad and I have a SQL Server 2005 installed on different machine in the same domain. But I can not connect to that server from LINQPad.

Here is the screenshot: Fail to connect

What do I put as a Server string?

Many thanks in advance!

Update 1: SERVERNAME\MSSQLSERVER does make a difference. Instead of Error

26 (Can not find server instance)

I get error

25 (Connection string is not correct)

I have tried 2 different SQL Servers: SQL 2005 on production server and Sql Server 2008 R2 on local machine, I have tried windows authentication and SQL authentication. And it makes no difference. But I can connect to both server (2005 and 2008) with MS SQL Server Management Studio with Windows and SQL server authentication. And it's not SQL Server permission issue - I have tried SA user to connect. It works with sqlservermanagementstudio, but not with LINQPad.

Any advice? Is there a setting on SQL Server I need to change?

Update 2: I found the solution to the problem. Into Server field I had to put SERVERNAME\ without specifying SQLEXPRESS or MSSQLSERVER.
Not very intuitive =(

like image 954
trailmax Avatar asked Aug 10 '11 12:08

trailmax


People also ask

Can I use Toad to connect to SQL Server?

Creating a Connection in Toad for SQL ServerCopy the server name from the Overview as listed in the Server name attribute in Figure 23. In the Create New Connection wizard specify the Server name in the Server name field as shown in Figure 24. Select Authentication as SQL Server Authentication.

Can RStudio connect to SQL Server?

Yes I am! RStudio includes the r-dbi/odbc interface, which enables you to develop R programs that can work with data from any database for which an ODBC driver is available. This blog shows how to use RStudio to connect to SQL Server from Linux by using Easysoft's SQL Server ODBC driver.

How connect MS SQL to eclipse?

Using the Data Source Explorer in Eclipse, create a JDBC connection to the SQL Server PUBS database. From the Main Menu, select Window > Show View > Other > Data Management > Data Source Explorer. In the Data Source Explorer, right-click Database Connections; then select New from the context menu.


1 Answers

I found the solution to the problem. Into Server field I had to put "SERVERNAME\" without any SQLEXPRESS or MSSQLSERVER. Also as pointed out by @sgmoore, I could just type "LOCALHOST" or "SERVERNAME" and it connected. Apparently this is SQL Server feature/bug, nothing to do with LINQPad.

UPD You can also use "." to denote "localhost" enter image description here

like image 167
trailmax Avatar answered Oct 29 '22 01:10

trailmax