How do you connect to database instances of different SQL versions? - sql-server

In my system, I am required to have two versions of SQL Server (2008 and 2019). Please don't ask why.
Onto my issue: I installed 2008 some time back, and am able to connect to the DB instance fine.
However, I recently installed 2019, and am trying to connect to my DB instance, which doesn't seem to be working.
Here're the steps I've done so far:
I installed SQL Server 2019 Developer Edition (Under C:\Program Files\Microsoft SQL Server, I now see the "150" and "MSSQL15.MSSQLSERVER" folders.
I opened SQL Server Configuration Manager, and see that the new instance is running (According to the Config Manager, SQLEXPRESS is the name of the old instance, and MSSQLSERVER is the name of the new one)
I opened CMD and executed sqlcmd -L, but only see the SQLEXPRESS instance listed.
How can I get my 2019 instance up and connectable?

MSSQL15.MSSQLSERVER
So it looks like you installed a default instance of SQL Server 2019. Good.
How can I get my 2019 instance up and connectable?
Check that the MSSQLSERVER service is started, and look at
C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log\ERRORLOG
to see verify that instance started, and run
sqlcmd -S localhost
to connect to the instance.

Related

Error 1067: "Windows could not start the SQL Server service on your Local computer" while attempting to start SQL Server service

I am unable to start the SQL Server service on my computer.
The service was working fine when I had windows 10 with SQL Server 2017 but after upgrading my computer to windows 11, the service is not getting started. I also tried reinstalling the SQL Server 2017.
Later I uninstalled SQL Server 2017 and installed SQL Server 2019 but still, I am not able to start the service and due to this, I am not able to connect my Management Studio with my database.
The error that I am getting in Event Viewer is:
Faulting application path: C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Binn\sqlservr.exe
Faulting module path: C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Binn\sqllang.dll
I have also checked in the "Local System Account" in Log On tab of the SQL Server service.
I have tried reinstalling SQL Server 2017, uninstalling SQL Server 2017 and then installing SQL Server 2019, creating new server with another name, etc. but the neither the service is getting started nor my SSMS is connecting to the database.
Thanks
I installed a new instance of the SQL Server in another drive and now the service has started running.
Note: Only the service for the new instance of the SQL Server (installed in Disk D) is running. The service for the previous instance that was installed in Disk C is not running.

How to create first Server Instance in SSMS

I have installed SQL Server and SSMS. And I open SSMS. The Connect to Database Engine Dialog is shown. But the Server Name is empty.
I don't know how to create a Server Name.
And I don't know where.
I also have tried to choose a fullpath name or local. But that doesn't work.
Can anybody help me? Oh... for both (SQL Server Express plus Management Studio I have the latest version).
In the drop down box for "Server Name" choose the option for <Browse for more...>. This will then give you a further window where you should see your instance listed under Local Servers:
One of the following:
You have installed Sql Server (not just SSMS), and during installation you specified a SQL Server instance for your computer and you DIDN'T specify an instance name. In that case you must
Make sure that the SQL Server service, called MSSQLSERVER, is running.
Connect to it with the name . (yes, just a dot)
You have installed Sql Server, and during installation you specified a SQL Server instance for your computer and you DID specify an instance name. In that case you must
Make sure that the SQL Server service, called MSSQLSERVER, is running.
Connect to it with the name .\InstanceName
You have install Sql Server Express.
Make sure that the SQL Server Express service is running. (I think the service name is also MSSQLSERVER)
Connect to it with the name .\SqlExpress
You have not installed any Sql Server version but you may have installed Visual Studio or something that include Sql tools, including LocalDb
start a localdb instance running with a command that is something like this (depending on your installed version):
'C:\Program Files\Microsoft SQL Server\150\Tools\Binn\SqlLocalDB.exe' start
Connect to it with the name, (localdb)\MSSQLLocalDb
You have not installed any Sql Server instance on your machine, and you are expecting to find a Sql Server instance somewhere on your network.
In this case you need someone who knows, to tell you the server name.
(You can create and start localdb instances with other names, MSSQLLocalDb is just the default or not having specified a name)
Start a service with e.g. PowerShell: Start-Service MSSQLSERVER or look for the service in the Windows' ⚙️ Services GUI you can find from Start Menu search.

SQL Server Management Studio 2017 not showing databases that were created in SQL Server 2016

I had Express edition installed of SQL Server 2016. I needed to use SQL Agent Jobs. For that purpose I installed a patch of SQL Server 2016 enterprise edition but it didn't worked. After that I installed SQL Server 2017 Developer edition which showed me the SQL Agent Jobs node (which i wanted).
After installation i was able to see my databases in both servers 16 & 17 connected locally. Today when I logged into my system and connected the instance of the server I'm not able to see my databases. When i try to attach the data files located at:
C:\Program Files\Microsoft SQL Server\MSSQL13.SQLEXPRESS\MSSQL\DATA
it does not show the file in the popup to attach it. Although in the file explorer I can see the file. For reference I have added an image of the list of databases, i cannot find my databases in it.
Any help regarding it would be thankful.
Screenshot from both SCM's.
You installed second instance (2017). You need to connect to 2016 instance (using /instance_name) and then make a backup, and then restore backup (+transfer logins) on 2017 server, and finally uninstall 2016. Or detach files on SQL 2016 instance and reattach on 2017 + uninstall.
Alternatively you need to choose in-place upgrade 2016-> 2017 instead of installing a new instance.

unable to connect to local server in SSMS 2014 (SQL Server 2014)

I need to run SSMS for my own practice and create a local database on the machine. But I am unable to connect to the local server
I have Microsoft SQL Server 2014 installed. It comes with SQL Server Management Studio version 12.0.4100.1
I type the server name
(localdb)\v11.0
But I am getting an error
I tried searching for server names by clicking on the 'Browse for more' option in the drop down of SSMS connection window, but could not find any server mentioned there.
I ran SQL Server Configuration Manager and went to SQL Server Services. There are no items available there
I tried running the below command through command prompt
NET START SQLSERVERAGENT
but it gave 'server name invalid' error
Can someone suggest other steps to debug and run the local server
Thanks #Ross Bush and #WEI_DBA
I had installed the setup SQLManagementStudio_x86_ENU.exe. I didn't realize that this setup did not contain the provision to install the db engine. I ran another installer SQLEXPRWT_x64_ENU.exe. And while running this setup, I selected the database engine services checkbox and installed. I am now able to connect to the local server.
Thanks Once againm for your help!

SQLExpress instance seems to be absent

I am trying to connect to a SQL Server Express instance on my laptop; I have SQL Server 2008 installed in my system, but when I try to put the instance (local)/SQLEXPRESS or Jashobanta-PC/SQLEXPRESS in my system, I am not able to connect to it. It is appearing that it is not even present in my system.
I am getting the following error :-
A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
I have tried using the SQLCMD command tool also for this, but the result is same:-
sqlcmd -E -S .\SQLEXPRESS
Here also the same error is appearing.
Is there any chance that SQLEXPRESS is not installed in my system? But as MVC Code First uses SQL Server Express, I need it. When I use code first, then the files are created fine, but how it is connecting, where it is creating the database, it is not known.
Any suggestions will be helpful.
Thanks in advance
Jashobanta
I had a similar issue to this, so for google purposes I'll list my result.
My take on the problem was that I had a SQL2008 Express instance, that had 'gone dark' because I'd installed a full instance of SQL2008R2 and/or SQL Express 2012. My guess is that one or the other of these turns off the out-of-date express instance as a security risk.
These instances were installed as fresh instance names, but somewhere along the way my (local)\SQLEXPRESS instance was disabled.
Using this link I used the SQL2008R2 installer to upgrade the SQLEXPRESS instance that the installer detected.
Once the SQLEXPRESS instance was upgraded to 2008R2 it was happily re-enabled and accessible at (local)\SQLEXPRESS, with all my previous databases inside it.
I have a same problem just now. What you need to do to resolve the problem is to install SQL Server 2008 Express edition.
You can do this by searching "SQL Express" from Web Platform Installer and install "SQL Server 2008 Express with Advanced Series" and "SQL Server 2008 Express with Tools".
Or
Download from this url and install.
http://www.microsoft.com/en-us/download/details.aspx?id=1695
.\SQLEXPRESS is SQL Express for SQL Server 2008 while
(LocalDB)\v11.0 is SQL Express for SQL Server 2012 / 14

Resources