how to clear the server drop down list of useless entries in Linqpad? - linqpad

In the LINQ to SQL connection window, the server drop down list now contains useless items from attempting to find the correct instance to connect to MS SQL server.
The only ones that work are (local) or localhost. Thinking that since .\SQLEXPRESS worked with SQL express version then .\MSSQLSERVER would work with the full version but I was mistaken! Anyway I digress, how do you clear these entries as pressing delete does not remove them?
If anyone can also explain the other related part about .\SQLEXPRESS and (local) working for express edition yet only (local) not .\mssqlserver (the default) on the full versions (Enterprise or Standard?

Delete %appdata%\LINQPad\RecentServers.txt
Which version of SQL Express do you have installed? The newest version is called LOCALDB and .\SQLEXPRESS will not work. Instead you must use (localdb)\v11.0

Related

Connect to SQL Server Developer edition

I recently installed Microsoft SQL Server Express for a project of mine, and I was able to connect to the instance with SQL Server Management Studio and everything worked fine. Then I realized that I needed the Developer edition for importing data the way I wanted, so I attempted to remove the Express edition and I installed Developer edition from Microsoft's website.
I tried to connect to the developer instance in SSMS first with [computer name]\MSSQLSERVER ([computer name]\SQLEXPRESS worked before) but that didn't work. I then tried many other things, including updating and reinstalling SSMS and the developer instance, and repairing the instance with the installation center.
When I look under the local server groups on SSMS I see the default one that's just my computer's name, and I see [computer name]\sqlexpress, but I don't see the one with the instance name of the developer edition (which should be [computer name]\mssqlserver, right?). Connecting the the express edition doesn't work anymore either, I think as a result of my attempts to uninstall it. Connecting to the default works, but it isn't Developer (which I know from trying to import data).
When I look at the Server Configuration Manager, though, it shows "SQL Server (MSSQLSERVER)" as a service which is running, but SSMS refuses to recognize it.
I'm a total beginner at this, so there's a good chance I'm missing something very obvious. I'm also unsure about the "connect now" button on the window that says "installation has completed successfully" which to takes you to the command line window, and whether that has anything to do with this. I don't really remember doing anything with it back when I installed express.
Any help is appreciated. Thanks!
The instance that's shown as SQL Server (MSSQLSERVER) in SQL Server Configuration Manager is the default instance to which you connect without specifying an instance name, just using one of these:
.
(local)
your-machine-name
as the server/instance name.

Can't connect to SQL Server local database and can't find the SQL Server browser

My problem is that after I installed SQL Server Management Studio and use .\SQLEXPRESS as a server name. It says that it can't connect it.
I read lots of things about that problem and one thing was to go to computer management and check the sql server browser if it is started.
When I go there I do not find any files for sql. On time of the installing I do everything correct as it is supposed to be. That's why I cannot understand why it doesn't work. Any ideas ?
I suspect that you have installed the tools only (SQL Management Studio) and not SQL Server itself. If you want to connect to your own SQL Server (any instance starting with a dot ".") then you will need to install it on your machine.
You can download the full installation SQL Express package direct from Microsoft. There are several editions available to suit your environment and needs.
http://www.microsoft.com/en-au/server-cloud/products/sql-server-editions/sql-server-express.aspx
It gets a little complicated trying to find what you want since there are so many variants and editions. I recommend that you head over to Scott Hanselman's blog where he has laid it all out very nicely by release version, edition and environment (32/64 bit)
His preferred link: http://downloadsqlserverexpress.com
Original post: http://www.hanselman.com/blog/DownloadSQLServerExpress.aspx
So, it seems it isnt installed... was it installed? Check google what it's folders are for your system and go look if the folders exist. Make a backup of existing folders and re-install if need be. then attach any existing files to to recreate the databases, if any.

Will creating a database using SQL Server Express 10 and using SQL Server Express 10.5 for running it cause any issue?

If I create my database using SQL Server Express 10 and in target system where my application needs to run SQL Server Express 10.5, will I face any problems?
On my system I have SQL Server Express 10 installed (I guess it was installed with Visual Studio 2010) after sometime I installed VS2012 and removed it couple of months later. In my application I use .\sqlexpress in the connection string, I am not sure whether this is a SQL Server 2012 Express version or a 2010 version which is being used on my system?
So I just wanted to know if moving to the new system would cause me any kind of incompatibility or weird and unpredictable results and to avoid them what do I need to install on the target machine?
And also what would be sufficient to be installed on the target system by the way?
When I search SQL Server Express, there are several versions with different sizes, which one is needed and is enough?
This is perfectly safe but you can't go back because the database will be upgraded.

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:
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 =(
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"
You have to know the name of the computer you want and the name of the SQL-Server instance. For example, I have a computer named REB602, and, to use SQLEXPRESS on it (the SQL-Server instance that comes pre-installed with many versions of Visual Studio), then the string I type in is either REB602\SQLEXPRESS or .\SQLEXPRESS. The format is basically <computer-name> \ <instance-name>
I think the default instance-name for the full SQL-Server product is MSSQLSERVER, so if you don't know the name of the instance on the target computer, you can try that.
NOTE: it can take several tries to get a connection, because of the timeouts. I don't know if LinqPad lets you change the timeout -- I didn't see a way. When testing out my answer for you on computer REB602 this morning, I did "Test Connection" at the bottom of the LinqPad dialog box, got success, but the connection still timed out. I had to bring up SSMS (SQL-Server Management Studio, the IDE for SQL Server) to "warm up" my instance of SQLEXPRESS. After that, LinqPad worked like a dream. Don't give up on the first try :)

Do I have both SQL Server 2005 and SQL Server 2008 installed?

When in 'SQL Server Configuration Manager' I see, under 'SQL Server Services', 2 items that look like SQL Server's:
SQL Server (sqlexpress)
SQL Server (mssqlserver)
Does that mean I have 2 versions installed at the same time? The 'SQL Server (mssqlserver) is currently stopped).
You have two instances. They might or might not be the same version (meaning 2005/2008).
Express is just an SKU / edition from the myriad of different editions.
You can have the same version or multiple versions/SKUs installed as different instances on the same machine.
So unless someone wittingly set up a new instance with the name "sqlexpress", you probably have two kinds of products installed (both can be 2008 or both can be 2005 or they can be different - it is just that one of them is presumably the Express SKU while the other is say Standard.)
You can get more information on the instances by using ##VERSION.
It looks like you got SQL Server Express installed with Visual Studio and then later installed SQL Server 2008. I've done this before and the best solution I found was to completely uninstall SQL Server Express and SQL Server 2008. Remove all the files in the Microsoft SQL Server directory in Program Files, then reinstall SQL Server 2008. If you still have problems getting the 2008 instance to be the default, you may also need to uninstall Visual Studio.
In the future, if you're going to install the development (or other) version of SQL Server locally, I suggest making sure you install it before Visual Studio. The VS install won't install SQL Server Express if it detects an existing SQL Server instance on the system.
BTW, you can verify if this is true by using the Add/Remove Programs Control Panel item.
SQLExpress is the light/free edition, usually used for developers or very lightweight applications.
MSSQLServer is the full blown SQL install.
So yes you have 2 "SQL Server" installs, but they are different products, I can't say which versions based on your provided data.
You have two SqlServer instances installed on your system. One is SqlServer Express Edition and the other one a Sql Server. I can't say which version or edition.
Maybe you can find some more information in the registry (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft).
I'd vote against removing either one--SQL server does fine with multiple instances and they are good for different things. For example, lots of open source projects presume a local copy of sql express at .\SQLEXPRESS for development use. Whereas you can't write analysis service stuff with SQL Express.
Or, its not a problem. Those aren't the droids your looking for. Move along.