Create/restore database from backup SQL Server Express Create/restore database from backup SQL Server Express sql-server sql-server

Create/restore database from backup SQL Server Express


Even with SQL Server Management Studio Express, you won't be able to restore this backup. The Express edition being installed with Visual Studio 2010 is version 2008 of SQL Server - your backup is one from a SQL Server 2008 R2 release - those backups cannot be restore onto a 2008 version.

You will need to download the SQL Server 2008 R2 Express version, and while you're at it - get the version with the Management Studio! Install this, and then you'll be able to restore your database backup.

If you really really want to restore your database without using Mgmt Studio - you can of course use a RESTORE statement in T-SQL and run this using the sqlcmd command line tool:

RESTORE DATABASE YourDatabaseNameFROM DISK = N'(path to your BAK file)'WITH FILE = 1,  MOVE N'(your DB name)' TO N'(your SQL path)database.MDF',  MOVE N'(your DB name)_LOG' TO N'(your SQL path)database_LOG.LDF',  NOUNLOAD,  REPLACE,  STATS = 10GO

(and of course, there's also a BACKUP command which you can use in a similar fashion - the MSDN Books Online are your friend for details about the syntax!!).


Late one but hopefully useful to others who are viewing this….

If the problem is restoring without management studio this can be easily solved by using sqlcmd as marc_s already pointed out.

However if the real problem is restoring 2008 R2 backup on SQL 2008 without using SSMS then only solution is using third party tools that can read backup and generate scripts for creating schema and inserting data.

Idea is to create empty database on SQL 2008 and use a third party tool to compare it to backup generated with 2008 R2.

I’ve used ApexSQL Diff and ApexSQL Data Diff with good success in my previous job but there are also good tools from Red Gate (SQL Compare) and Idera (Comparison toolset). If you look up online you’ll probably find a lot more….

Disclaimer: I’m not affiliated with any of the companies mentioned above…


Why don't you get SQL Managment Studio Express? It is free, and should allow you to administer local sql express instances.

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796

BACKUP DATABASE [AdventureWorks] TO      DISK = N'\\nas\Backup\L40\SQL2005\AdventureWorks_backup_200702120215.bak'     WITH NOFORMAT, NOINIT,  NAME = N'AdventureWorks-Full Database Backup',     SKIP, NOREWIND, NOUNLOAD,  STATS = 10RESTORE DATABASE [AdventureWorksNew]     FROM  DISK = N'\\nas\Backup\L40\SQL2005\AdventureWorks_backup_200702120215.bak'     WITH  FILE = 1,      MOVE N'AdventureWorks_Data' TO N'C:\Data\MSSQL.1\MSSQL\Data\AdventureWorksNew_Data.mdf',      MOVE N'AdventureWorks_Log' TO N'C:\Data\MSSQL.1\MSSQL\Data\AdventureWorksNew_Log.ldf',      NOUNLOAD,  STATS = 10