LocalDB Separate Install Connection String - sql-server

Our tool uses SQL Server 2012 LocalDB to store data. This as installed by the MSI, not full express. Users recently moved to new machines using other applications that connect via SQL Server 2019.
My understanding is that installing SQL Server LocalDB on top of an installation of SQL Server 2019 shouldn't cause an issue, being as how SQL Server Express installs as a named instance by default.
My concern when I look at connection strings, however, is that mine doesn't identify the server instance quite in the way I've seen recommended, only the Data Source:
Data Source=(localdb)\v11.0;Integrated Security=True;AttachDbFileName=C:\Database\Database.mdf;Connection Timeout=10000
This does connect, in case there's doubt. But referencing connectionStrings.com, I see recommended this:
Server=(localdb)\v11.0;Integrated Security=true;AttachDbFileName=C:\MyFolder\MyData.mdf;
In my mind, Data Source=(localdb)\v11.0 is already a clear designation of the instance, but I'm unsure what happens when SQL Server Express installs after SQL Server.
What should I look out for? Do I need to replace Data Source with Server? Will I need to change any part of (localdb)\v11.0 to account for the order SQL Server Express has been installed in compared with SQL Server?
EDIT 1
Updating the connection string by replacing 'Data Source' with 'Server' works. The question still remains, how will LocalDBs installing second affect what follows Server=?

Related

Cannot connect to SQL Server localDB through ODBC

Everything was working fine until I made a few changes (including installing VS 2022), and I can't figure out which change caused the problems.
I connect an access front end to a local SQL server through ODBC. I do this on a number of computers (then sync the databases through azure). Some are regular SQL Express instances, and some are LocalDB.
The computer that stopped working is one that uses LocalDB. The entire instance got corrupted. After I was able to delete the instance and recreate it. I can now connect through Azure Data Studio, and Visual Studio, etc. I just can't connect through ODBC. I've tried all of the different drivers including SQL Server Native Client 11.0, ODBC Driver 17 for SQL Server, and more. None of them work.
What does work, is if I use the named pipe url directly in the server section of the ODBC setup. So instead of putting (localdb)\MSSQLLocalDB I put np:\.\pipe\LOCALDB#D26172B4\tsql\query. That does work, but the instance id in that URL changes every time the instance starts. So every time the computer restarts we need to create a new ODBC connection. That is not a maintainable solution.

Deploying Windows application with SQL Server database

I have a WPF project and I will use SQL Server database. The instance of SQL Server IT created for me is SQL Server 13 (2016 standard version) on a remove server. When I’m deploying the application on a client’s computers, what version I need to install there as a prerequisite? Can I deploy SQL Server Express 2016 on a client’s computer and access the remove SQL Server Standard edition? I am looking for a simple solution and for a lighter version I need to install on the user’s computers. I cannot install a full SQL Server on each user.
I have searched the net and a similar question has been asked many times, but I didn’t find a clear answer before. Many people started their SQL Server experience using local type databases, like SQL Server CE or LocalDB. In this case specific DLLs and redistributables must be added with the installation program. It is hard to understand at the beginning, but when an instance of SQL Server is on a remote server, this is a different story. Everything is happening on this remote server. There is no need of any SQL Server instances on a client’s machine. Just a connection string must be added. The adapter or Entity Framework will take care of everything else.

Configure remote connections without sql server installation?

We have an application called IpSwitch Whatsup and it's installed in a machine that I can connect to remotely as administrator. This is all in our intranet.
We need to connect to the sql server database being used by IpSwitch Whatsup, but this particular machine doesn't have sql server installed. On the other hand, in sql server configuration manager there is indeed a sql server installation for whatsup (the entry says SQL Server (WHATSUP)).
So, two questions:
How does one go about in connecting to this database? I'm pretty sure I know the name of the database and I already know the server name and instance, so I would like to connect to this DB from a sql server installation in another machine.
How does one configure a sql server installation to receive remote connections if it doesn't have sql server installed?
Thanks.
For the first question, you just type in (or browse) the appropriate instance name and authentication options using SSMS - which is the GUI tool used to manage sql server instances. Note - the term "sql server installation" can mean different things so it is not a useful reference.
As for the second question, review the information here. Note that any task you do in SSMS can be done via tsql - you can see the appropriate commands using the script button in the SSMS dialog windows.
And you can also (and probably should based on these questions) install SSMS on the same machine as your server instance so you can do "anything" "anywhere". Now would probably be a good time to review your disaster recovery options (and start backing up your databases regularly).

How do I create an SQL Server?

I have a very fundamental and basic SQL question. Using Microsoft SQL Server Management Studio Express, how do I create my first Server? For that matter, how would I create it using any other required software tool?
I took a look at Sql Server Configuration Manager and I saw SQLEPRESS running as a SQL Server. But when I added that in to the start up widow for MSSM Studio Express, as the server name, it threw an error saying it cannot be found or does not exist. It seems that this is not the right kind of server.
To connect to the local instance of SQLEXPRESS, you will need localhost as the server name.
This is a fairly comprehensive guide on how to create a database once you have connected. All the steps won't apply to using SQL Express, but the gist of it is there.
In Object Explorer, connect to an instance of the SQL Server Database
Engine and then expand that instance.
Right-click Databases, and then
click New Database. In New Database, enter a database name.
To create
the database by accepting all default values, click OK; otherwise,
continue with the following optional steps.
Based on this comment:
Trying .\SQLEXPRESS in SQL Server Management Studio Express throws an error that says that "This version of Microsoft SQL Server Management Studio Express can only be used to connect to SQL Server 2005 servers". So this is the problem, I think.
.\SQLEXPRESS is the correct server name, but you have the wrong version of client tools (SQL Server Management Studio). To find out the version of SQL you are connecting to, there are a number of suggestions here: https://www.mssqltips.com/sqlservertip/1140/how-to-tell-what-sql-server-version-you-are-running/
But since you can't connect yet the easiest thing to do is go searching for sqlserver.exe, right click, properties, version. If you have multiple version you need take note of the folder that it's in and check the SQLExpress one. You can also check in services.
Once you've worked out the version, download and install just the management tools for that version.

Sql server instance id is required but don't have other instances installed

I am trying to install SQL Server 2014. In the setup, I have clicked on Default instance (rather than Named instance) and want to make the Instance ID empty. My main goal is to be able to connect to SQL Server using just .\. But I am being forced to input an Instance ID even though I am pretty sure I shouldn't need to put one in if there are no other instances installed (which there are not). I am using this guide here and am at step 14 which shows screenshots of what I am seeing:
http://www.exactsoftware.com/docs/DocView.aspx?DocumentID=%7Ba6937c87-21f5-46db-a166-ba84e83037e3%7D
Now it could be that I have misunderstood, and Instance ID is always required, but if not, do you know why I am forced to put one in?
Please note, that it automatically sets an InstanceID of MSSQLSERVER.
Also, I currently have the following things installed:
Microsoft SQL Server 2014 Transact-SQL Compiler Service
Microsoft SQL Server 2014 Transact-SQL Compiler ScriptDom
Microsoft SQL Server 2014 T-SQL Language Service
Microsoft SQL Server Compact 4.0 SP1 x64 ENU
Microsoft SQL Server Data Tools - enu (14.0.50616.0)
Microsoft SQL Server System CLR Types
Do I maybe need to uninstall any of these?
Even a default instance has a name, in this case MSSQLSERVER.
This is because the directory structure of the SQL-Server installation, the registry entries and service names reflect the name of the instance. For a default instance there is no need to specify the name of the instance to make a connection.
https://msdn.microsoft.com/en-us/library/ms143531.aspx

Resources