Different SQL server Versions on the same Windows - sql-server

I need to have SQL server 2005 and SQL server 2014 on the same Windows 7 machine.
My situation is as follows. I have 2 versions of the same program:
The first version uses SQL server 2005 databases with names DB1 and DB2.
The second version uses SQL Server 2014 databases with the same names DB1 and DB2.
How would I go about doing this?

Although I have never tried the above combination I have installed mixed versions of SQL server on the same computer (with Windows 7). The method is:
Always install the older version first
When prompted give it an instance name
Install the new version; don't choose the upgrade option
Give it a different instance name
Remember that SQL server 2005 is now out of support so you will need to download the most recent service pack and install it manually.
You can read more about it here.

Related

Trouble after Upgrade SQL Server version and have two server now in services.msc

I'm a beginner in this, I've been searching for long on internet. But as many solution in internet, I don't understand as much i wanted. And I have some question to for resolution. I see a place the recommend to ask some like this as Super User, but I recently just started using 'Stack Overflow' so I don't know How To Use Super User.
Start when I download a new setup of SQL Server 2016 and choose option to 'Upgrade-from-previous-version', from process I see, it just added 2 features.
From what I really want is to change entirely my SQL server from 2014 to 2016.
Two Server in services.msc
So i try to do option 'basic-installation' from installer and it work honestly but provide 2 server which server 2016 and 2014.
Maybe I can just uninstall the server 2014, and get work with 2016 instead. But Can I bring my database in 2014 too?, I mean it has compatibility-problem.
And it don't have SQL Server Management Studio so I download a newest version of it (v18.00)
Two server with different SQL Server version
My question is =
Can I keep my database in server 2014, my database in 2016 is empty (did I must attach it again)?
Did it just OK to have two Microsoft SQL Server Management Studio?
Why I don't get MSSMS when I install SQL Server 2016?
If I must do Question1, How To Upgrade my database to version 2016?
Is it bad for my laptop to having two Version of SQL Server, or I must delete one?
Backup and restore to 2016 (or keep it in 2014)
Yes, but not necessary, just use latest version, uninstall older
Management Studio can be downloaded separately
See (1)
No, both can be kept, but remember that both services will be running which may impact performance and resource usage. You can stop these services using SQL Server Configuration Manager

Northwind.mdf - This database file is not compatible with the current instance of SQL Server (in Visual Studio 2017)

I want to practice with some database that I want to use inside Visual Studio 2017.
I had Northwind.mdf that I downloaded some time ago. But when I try to connect to it from VS2017 Servers panel, I get error message:
This database file is not compatible with the current instance of SQL Server.
Q1: Why?
Q2: Where and how do I know the version of Northwind.mdf?
Q3: Where and how do I know which version of database is supported by VS2017?
Q4: I can create my own database in VS2017, but why I cannot use the existing database?
SQL Server only supports databases up to two versions ago, I don't know what version of SQL Server comes with VS2017 but I suppose that is at least SQL Server 2016 (you can check it using the query select ##version), so it supports at most DB's from SQL Server 2012 and Northwind is for SQL Server 2000.
If you really, really want to use that database you have an upgrade path, is a bit cumbersome but is free (you should use a virtual machine for this if you can, I sometimes use the VM's that MS offer for testing IE for this sort of things):
Download and install SQL Server 2008 R2 Express, which is the last version that supports databases from SQL Server 2000. Import the database and make a full backup (you can also attach and detach the database files but I prefer to use backups).
If the version returned by select ##version if SQL Server 2016 or higher, download and install SQL Server 2014 Express. Restore the backup from 2008 to a new database and then make another backup of that database (if you are using this version just restore the backup in your current SQL Server and you are done).
Finally, restore the 2014 backup in the SQL Server used by VS2017.
Note that is you already have SQL Management Studio (or it's integrated in VS2017) you don't need to install the previous versions, since it can connect to different SQL Server versions (if you do all the installs on your system you shouldn't install the previous versions of Management studio, take care of this). Also, if you are doing this in your system I recommend uninstall the step versions as soon as possible.
i have the same problem, i want to use the northwind in VS2017 environment.
(btw - w3scoolsuse this northwind db to teach sql (october 2018)
so i download the sql script from here, install it and run it from cmd in my computer
sqlcmd -S (localdb)\mssqllocaldb -i InstNwnd.sql
This create db in my computer that i can access by sqlcmd, and by visual studio 2017.
If you want those files (without build it yourself) you can download it from my google drive ( i will upload it to github someday and change the link)

How to install sql2005 on sql2008r2?

I am poorly experienced in SQL Server installations. I have already installed 2008r2 on Microsoft Windows 8.
Now I want to install MS SQL Server 2005, but I need both MS SQL Server 2008r2 and MS SQL Server 2005.
How can I install this?
You can install both versions on same computer..
From MSDN:
SQL Server supports multiple instances of the Database Engine, Analysis Services, and Reporting Services on the same computer. You can also upgrade earlier versions of SQL Server, or install SQL Server on a computer where earlier SQL Server versions are already installed.
There's a couple of problems here; firstly SQL 2005 isn't even compatible with Windows 8. Windows 7 you can just about get away with it with some patching. Next you need to install the instances and tools in version order. So SQL 2005, then SQL 2008.
You could try uninstalling SQL2008, but you'll probably find too many updates and bits have occurred to get back to a state that might allow you to try doing SQL2005.
My recommendation would be; format the host machine. Install Windows 8. Setup HyperV virtual machines for each version of SQL Server in an operating system that's more inline with the SQL product. Eg. Win2003 for SQL2005. Win2008 for SQL 2008.
He's a block post of doing this to create a manageable developer workstation running every version of SQL Server: http://www.purplefrogsystems.com/paul/2016/05/using-hyper-v-and-powershell-to-create-the-perfect-developer-workstation/

Cannot restore a database with a .bak file due to another SQL server version

I have installed SQL server 2008 R2 and i try to restore a database a colleague sent me in a .bak file.
Unfortunately, i cannot restore the database since the database was saved on a server from version 10.50.1600 and my SQL server version seems to be 10.00.1600.
I tried to upgrade my SQL server with SP1 and SP2 packs but it didn't change anything.
Otherwise, i noticed by clicking on the server property that the line "product" displays Microsoft SQL server Express edition even though i have installed SQL server 2008 R2. That's at least what is displayed when i fire it...
Can anyone help me ?
Thanks in advance
You CANNOT do this - you cannot attach/detach or backup/restore a database from a newer version (SQL Server 2008 R2 - 10.50.1600) of SQL Server down to an older version (2008 - v10.00.1600) - the internal file structures are just too different to support backwards compatibility.
You can either get around this problem by
using the same version of SQL Server on all your machines - then you can easily backup/restore databases between instances
otherwise you can create the database scripts for both structure (tables, view, stored procedures etc.) and for contents (the actual data contained in the tables) either in SQL Server Management Studio (Tasks > Generate Scripts) or using a third-party tool
or you can use a third-party tool like Red-Gate's SQL Compare and SQL Data Compare to do "diffing" between your source and target, generate update scripts from those differences, and then execute those scripts on the target platform; this works across different SQL Server versions.
Understand, what the version numbers mean. You need to be on R2 which is not just a patch or service-pack.

Database created in XP to be opened on Vista

I have a database in SQL server which is created on xp and to be opened on vista
When i try opening it on Vista.
Would this be possible
Thanks
Sun
SQL Server creates files that SQL Server can read. The file formats are independent of Windows versions.
What you should be aware of/considering are SQL Server versions and editions.
For instance, if you create a DB using SQL Server 2008 R2, you will not be able to attach/restore such a database using SQL Server 2005 or 2008, no matter what OS you're working on.
Similarly, if you've applied a particular service pack to the installation where the .mdf originates, you need to be working at the same or later service pack on the system where you want to read the file.
Similarly, if you create a database that uses features that are only available in higher level editions of SQL Server - i.e. something only available in Enterprise/Developer edition - you may have issues using the same database on a Standard Edition installation.
You don't open a sql server database with "xp" or "vista". You open the database in Sql Server. That's all that matters here: does the machine have the correct version of Sql Server available? Note that no version of Windows ships with Sql Server installed by default.
Also, unless you're talking about Sql Server Compact Edition you might want to re-think this. Full editions of Sql Server belong on the server editions of Windows. If you're building a database for an app that will live on individual user's desktop and the database will only serve the instance of the app on the machine, do not use sql server for that database. Instead, use something like Sql Server Compact Edition (it uses a different engine than full sql server that is more desktop-friendly), SQLite, or even Access.
Yes, there is no reason why this should not work.
As #Demian said, you can not open database created in SQL Server 2008 R2 in SQL Server 2008. But alternatively if you are sure that your database is not using any features specific to R2, you can script out whole database and then create similar database by running those scripts into SQL Server 2008 (ofcourse with some changes in script). And then just write some insert scripts to import data from 2008R2 to 2008 (Or you can use SSIS to dump data from one location to another location)
I think the question itself is pretty unclear. No explaination of environment of both XP and Vista machines (e.g. DBMS versions including SPs) or how you are trying to open/access database (using attach or by restoring backup). Without proper information I don't think there is any EXACT solution.

Resources