Upgrade Pubs and Northwind Databases Failed in Visual Studio 2013 - sql-server

I'm using VS Ultimate 2013 and SQL Server 2014 Standard. I try to upgrade Pubs and Northwind databases but the operation fails with the following snapshot:
Besides that, I followed paths introduced in some corners of the net but I got no interesting results. What should I do?
Thanks
Update[Problem solved by #marc_s]:
The SQL Server 2012 Northwind database version bypassed the obstacles I had. Here's the link: http://businessimpactinc.com/install-northwind-database/

The error says
User instance flag is not supported on this version of SQL Server
You seem to be trying to use
User Instance=true
in your connection string, but that is supported exclusively in SQL Server Express - no other edition (and therefore, it's not supported on SQL Server Standard).
You will need to attach the .mdf files (or run the creational SQL scripts for those two databases) on your server instance¨and then connect to those database on the server

Related

An iIssue with SQL database attachment via Visual Studio

Me
An SQL newbie
My tools
VS Community 2017 v15.9.3 / C#
SQL Server 14.0.2002.14
SSMS 14.0...
What I want to do
I have a file, you say mydatabase.mdb, I am trying to create a connection to the database on SQL Server to access to it.
The database is not actually attached to SQL server, so I try to create my connection and attach it (correct?) using Server Explorer window on VS. I right click on "data connection" then choose "add connection"; in the "add connection dialog" I select the datasource "Database file of Microsoft SQL Server" and I give it the pathname of my file. Finally I hit "Test Connection".
The problem
On "Test Connection" I got this message:
The database 'mydatabase.mdb'cannot be opened because it is version 869. This server support version 852 and earlier.
Could not open new database 'mydatabase.mdb', CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file 'mydatabase.mdb' failed. A database with the same name exists, or specified file cannot be open or it is located on UNC share
My attempts
I connected the databse to SSMS. When I asked DB version to SSMS, I got: SQL Server 2016 (130). It is not congruent with MS error report. Anyway I changed database version to 2014, then I detached it from server and try again: same result.
Last note: if I create my connection on attached (by SSMS) database, and specifing directly the SQL server (not the file) as datasource, it seems to work. I could use this way, but I'd like to know the cause of the problem.
Can anyone help me?
You may have installed VS 2012, but you are using a SQL 2008 instance: Visual studio does not install SQL for you.
SQL Server 2008 databases are version 655. SQL Server 2008 R2 databases are 661. You are trying to attach an 2008 R2 database to an 2008 instance and this is not supported.
You need to upgrade your SQL instance to at least 2008R2 to open the file (but be aware that if you subsequently attach your existing DBs to the new instance, you won't be able to open then in SQL 2008 again either)
Your SQL Server version (the server that reported the error) is 2016, that is, it supports db version 852 and earlier.
The database that you try to attach is of version 869, this means it was created on SQL Server 2017.
You cannot attach it to an earlier version of SQL Server, so you need to upgrade your server to 2017 or install another instance of SQL Server, SQL Server 2017.
P.S. You CANNOT downgrade database version, i.e. when you said
I changed database version to 2014
it is not true.
Maybe you just change the compatibility level of database, but it's version is still 869.
Compatibility level means a version of cardinality estimator to use + some features, it has nothing to do with database version that refers to physical file format. Database version cannot be downgraded, only upgraded.
P.P.S.
I connected the databse to SSMS
You cannot "connect database to SSMS", you are connecting to server, and the database is also attached to server. And if you were able to attach this database to SQL Server, this means you have SQL Server 2017 already installed.
P.P.P.S. To detect your SQL Server version you shopuld execute this code: select ##version (from SSMS). It seems that you have at least 2 servers, 2016 and 2017 on your pc. You can verify this by opening SQL Server Configuration Manager, or you can use Windows Services to determine how many instances you have and what are their names. Then all you should do is to use the correct instance.
Here is the picture of my SQL Server instances, you can verify your instances by launching services.msc on your pc.

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)

Compatibility issue between SQL Server and Visual Studio

I think you can help me.
I am developing an application for a small company. I have been working on Visual Studio 2015 with a SQL Server 2014 database and I have made a noob mistake. My app was almost finished but I discovered that the company has only one server with Windows Server 2003 on it, and it is not possible to update it.
Windows Server 2003 works up to SQL Server 2008 so I have tried but it has been impossible to me to attach my database to SQL Server 2008 (even changing compatibility level to 100) or connecting a new 2008 database to the application in Visual Studio 2015.
I do not know what to do now. Is there some possibility to make that my database works? Or is any other DBMS that would be better to work with my 2015 app in my 2003 server? Thanks!
You can create a database in production SQL Server 2008, then
create a Linked Server on your production Server to your development SQL Server 2014 and copy all the tables / procedures / functions over.
How to Create a Linked Server
Backup/restore works with older backup/newer restore server. Detach/attach do the same. The best solution here is to script developer DB (make sure you don't include newest features not supported by the production server) and run on production. If you want to move data as well, it is better to create at least two separate .sql's, one for schema and another for data.

SQL Server version 612 , 655?

I have SQL Server 2008 and VS2008 installed on my computer and I am trying to run a web application I've created on a computer which has SQL Server 2008 and VS2008 and VS2010 beta 2 with its SQL Server Express.
I am getting an error with the database version that is
"...aspnetdb.mdf" cannot be opened because it is version 655. This server supports version 612 and earlier...."
Configuring the database in Visual Studio ->Tools -> Options -> Design-Time Validation Database is not working since I don't have the SQL Server version comes with VS 2010.
EDITED : I also edited aspnetdb and inserted a few more tables so I need the same aspnetdb
Is there any solution to convert this db ?
Also, after fixing this, I am looking forward to upload it on my hosting which has SQL Server 2005 DB and configure it in PLESK.
The SQL Server databases have a version specific format. Each SQL Server runtime version (SQL 2008 SP1, SQL 2008 RTM, SQL 2005 SP2, SQL 2005 SP1, SQL 2005 RTM etc) knows how to upgrade to its own verison. Unfortunately, once upgraded the database cannot be downgraded. So if your MDF was upgraded to version 655, it cannot be downgraded to any prior version. If you know you're going to deploy on SQL Server 2005, you must develop on SQL Server 2005 too. Not only that, but the actual build number of your development has to match the build number of the deployment (or at least be lower than that): the SP level and CU level must match.
You can a attach the 2008 version MDF you created to a SQL Server 2008, script out the database content, then import the script into a SQL Server 2005 database of the proper version.
I had this problem and when I changed my_computer_name\SQLEXPRESS with . to connect to server and it works and I could attach MDF file
may be you have both services run. (Mssql2008 and mssqlexpress) Maybe you have runing the mssqlespress running, that's the error that you have. Try to stop the mssqlserver express service and run mssql2008 services, and attach again your databases. I try this and works for me

Why won't Visual Studio 2008 create .mdf files with SQL Server 2008 Developer installed?

I'm trying some of the ASP.NET MVC tutorials and one of them has the following steps:
Right-click on the "App_Data" folder, and choose "Add New item"
Choose "SQL Server Database" under the "Data" category.
However, once I do that, I get the following message from Visual Studio:
Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function proprely. Please verify the installation of the component or download from the URL...
The thing is that I have SQL Server 2008 Developer Edition installed, and I would really rather not install any Express versions (2005 or 2008) if I don't have to. Is there a work-around for this issue?
I ran into this problem too on 64-bit Windows 7 (using 64-bit SQL Server Express 2008).
There are two methods of fixing this problem referenced in the Microsoft Support Knowledge Base article:
1. Workaround
To work around this problem, uninstall
the 64-bit version of SQL Server
Express 2008, and then install the
32-bit version of SQL Server Express
2008.
If you don't want to do the uninstall/install, then try the Hotfix method below.
2. Hotfix
A supported hotfix is now available
from Microsoft. However, it is
intended to correct only the problem
that this article describes. Apply it
only to systems that are experiencing
this specific problem.
Although the article itself doesn't include a link to the hotfix, you can get it here:
http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=957944
To illuminate masfenix's reply, SQL Express supports one feature that is not supported by full-blown SQL Server: a "user instance" database. With SQL Express installed and an mdf file in your App_Data folder, the application will dynamically attach and detach it as needed. For hobbyist or small business sites, this may be perfect. If you're running SQL elsewhere in the enterprise, you probably don't want to go this route and therefore the feature isn't useful to you.
Actually SQL express is a whole different database engine then SQL Server 2005. So yes if you want to use mdf files you'd need SQL Express.
I want to point out that I have both Developer edition and Express edition installed. And I still run into the same error. I think Express edition must be installed as a single instance.
I have the same problem but I've sql 2008 express installed.
any way to make it work with sql 2008 express so I don't have to install the 4th sql instance on my machine??
I already have sql 2005, sql 2008, sql 2008 express
what the F... :)

Resources