How to import Sql Server 2008 database into sql server 2012 - sql

My problem is I am working on a project and its database is created in SQL Server 2008. But I has SQL SERVER 2012 installed in my PC. I cannot import this file into my sql server and also cannot connect this database file with visual studio 2013
Help me please

The easiest way is creating a database backup in 2008, and restoring that into 2012. Should work without any issues, and the restore process will automatically upgrade the database to 2012.
Alternatively, it should also be possible to detach the database from 2008, after which you can copy the files (Do not move them, but copy. That way if anything goes wrong, you have a fallback option). You should then be able to attach it in 2012, which again, will convert the database to 2012.
There's also an option of using the copy database wizard from inside SSMS, which also converts the database.
Please note that if you convert the database, from that moment onwards, all other developers will have to upgrade to 2012 as well.

Related

SQL Server 2005 mdf file on 2012

I have a SQL Server 2005 .mdf file I need to install on a server. Can I simply install SQL Server 2012 Express and attach the .mdf file without any issues, or should I stick to 2005 Express to eliminate any issues that may arise?
I should also add it needs to support a ASP.NET 3.5 website.
Cheers
If you have all files (mdf, ldf and potentially multiple ndf) and the database was cleanly shut down, you won't have an issue attaching to 2012.
If you have only the mdf it might work but it could also fail.
Either way, first take a backup of the files you have.
That being said, make sure you don't use any features that changed between 2005 and 2012 (see http://technet.microsoft.com/en-us/library/ms143532.aspx for details)

Microsoft SQL Server 2012 Expired

I've been working on this ASP.Net Project for a few months, and today my SQL Server 2012 Management Studio has expired. Completely overlooked that i may have been using a trial version and not the express edition. I can not access SQL management studio as it says the evaluation has expired.
Is there a way i can downgrade to the express edition (Free), without losing any databases?
Is there a way i can still backup/export the database i have been working on? Ive tried using the import/export 64 bit tool, but ive forgotten my sql server password. I had just been using the default all this time.
Thanks
Backup database: You can get close backup of your databases by copying the data and log files from your Data directory. You can do this just using Windows copy and paste command.
Re-install from trail version: I faced this problem for SQL Server 2008 trial version. When SQL Server 2008 expired, I was able to re-install it as follows:
a) Remove or uninstall all tools of SQL Server completely from Control Panel > Programs and Features.
b) Then, re-install SQL Server as a new fresh tool.
c) After completing the installation successfully, Cope and paste those backup data and log files into new data directory of new installation.
d) Open SQL Server Mgmt Studio and attach the data file to re-create your old database. Your database will be resumed in this way.
I believe you can do this procedure for your SQL Server 2012 trial version too.

SQL Server 2000 / SQL Server Management Studio 2008 - How to copy a database?

I'm connecting to a SQL Server 2000 server with SQL Server Management Studio 2008 and need to make a copy of a database.
Right-Click the database and pick Copy Database brings up the nice wizard. When I pick the destination server (the same server as the source server) the wizard happily tells me I need SQL Server 2005 or better and stops.
How can I make a copy of the database? I have no access to the computer other than through the management studio. Upgrading the server is not an option that is available to me.
You'll probably need to backup the DB, then restore it with a the new name (and then get someone with access to do the clean up). This should be OK as long as you make sure that the physical file locations are updated when you choose a new db name.

Convert SQL Server Express 2005 .mdf to 2008 .mdf?

Hi I have a Visual Studio solution and an ASP.NET MVC project that uses a SQL Server Express 2005 database file in the App_Data. I want to know how I can upgrade this file so it works for SQL Server Express 2008 ?
Thanks
You can issue the Attach command in SQL Management Studio 2008. It will name the database with the path to the .mdf, but it'll use it no problem.
The database will be in 2005 compatibility mode, but you can certainly change that yourself as you see fit.
All you have to do is create a backup (.bak) of your 2005 db and then restore it on your 2008 Express server. It's that simple.
If you want to deal with it on the file level, simply detach from 2005 and attach to 2008. If it's solution-created in your AppData all you should have to do is move it to the newer project.
alt text http://img714.imageshack.us/img714/4514/sqlserver.jpg
Looks like this database is actually 2008 from what that compatibility level says so I think I am ok. I figured out how to attach the file in SQL Server management studio but thanks for mentioning about the compatibility mode.
I tried out making a backup and then restoring it using the backup file as a database and it made a new mdf file in the same folder as the original which is what I wanted, wasnt very clear that it was going to do that. Thanks

Importing Sql Server 2005 database into Sql Server express 2008

Is there any way to import a database backup from 2005 into 2008 express edition. What I've had to resort to is doing a script the database, then import all the data through DTS. Whenever I tried to import straight from a backup file it says something about not being to import into a new version of sql server or I'll get the below error.
title: Microsoft SQL Server Management Studio
Specified cast is not valid. (SqlManagerUI)
SQL 2005 backups should be restored on 2008 without problem (have done that myself many times). What exact error message did you got about versions?
The other error (Specified cast is not valid) seems to be Management Studio error, not server error. Have you full rights on 2008 server?
Look at this question - any-reason-to-have-sql-server-2005-and-2008-installed-on-same-machine - there are talked both about restoring SQL2005 backups and about attaching SQL2005 data files.
(Of course you cannot attach production databases. To attach non-production databases just detach them, make file level copy of these and attach copies to new server. Orginal files need to attach to original server too :))
I imagine that you are in a development process where your data will have to be regularly copied to you SQL 2008 server.
You can then think of configuring a replication between the SQL 2005 server (publisher) and SQL Server Express 2008 (suscriber). Depending on your requirements, you have the choice between snapshot or merge replication. If no update is done on the suscriber side, go for snapshot.
Once you want to have your 2008 server running independantely from the publisher, just delete the replication.
A valid SQL Server 2005 Express backup file should be able to be restored to SQL Server 2008 Express. If the SQL Server 2005 backup is from the Standard or Enterprise versions, you might hit problems restoring it to Express. The user context that the backup was created from should not affect the ability to restore that backup.
One thing you can do is to try running the restore operation as a verification, without actually trying to run the restore. That will tell you if the backup file is valid or not. You can use this syntax:
RESTORE VERIFYONLY
FROM yourbackupfile.bak
If possible, I would also suggest trying to simply detach the original database from 2005 and then attaching the file at the 2008 edition.
While I have only tried this with the standard edition myself, it has worked perfectly with the compatibility mode keeping the database set to 2005.
Have you tried running the Upgrade Advisor http://www.microsoft.com/download/en/details.aspx?id=11455 - it might be able to highlight problems for upgrading the original database.