0

I created a database on SQL server 2012 on Windows 7 and I want to work with this database on Windows XP which has a sql server 2008 installed. The problem is when I want to attach the database in sql server 2008 it gives me this error message :

TITRE : Microsoft SQL Server Management Studio
------------------------------

Échec de Attach database pour Serveur « MAC-BOOK-AIR\SQLEXPRESS ».  (Microsoft.SqlServer.Smo)

Pour obtenir de l'aide, cliquez sur : http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.1600.22+((SQL_PreRelease).080709-1414+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

------------------------------
INFORMATIONS SUPPLÉMENTAIRES :

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

The database 'GESTION_STAGE' cannot be opened because it is version 706. This server supports version 612 and earlier. A downgrade path is not supported.
Could not open new database 'GESTION_STAGE'. CREATE DATABASE is aborted. (Microsoft SQL Server, Erreur : 948)

Pour obtenir de l'aide, cliquez sur : http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=948&LinkId=20476

Is there any possibility to attach the database without installing an earlier version of sql server ? Because I can't install sql server 2012 in Windows XP.

user1652624
  • 31
  • 1
  • 2
  • 6
  • Possible duplicate: http://stackoverflow.com/questions/6183139/sql-server-database-backup-restore-on-lower-version – Tim Lehner Sep 11 '12 at 20:38

2 Answers2

1

No.

You can't attach newer SQL server databases to older SQL Servers. Nor can you restore a backup from a newer SQL Server to an older SQL Server.

Your best option is scripting the structure and data in SQL 2012, and running the generated scripts on 2008.

podiluska
  • 50,950
  • 7
  • 98
  • 104
0

One option is to script the structure and data and execute these scripts against a SQL Server 2008 database. To script a database

  1. In SSMS Object Explorer right click a database
  2. Select Tasks, Generate Scripts
  3. Check 'Script all objects in the selected database'
  4. Set ' Script for Server version' to SQL Server 2008
  5. Here's the catch - 'Script data' is set to false by default. Set it to True to get the data scripted, too
  6. When the script is created, create a database with the same name on SQL Server 2008 and execute the script

Another option is to use a tool that will compare and synchronize the database on SQL Server 2012 and a blank database on SQL Server 2008. Most of these tools synchronize first structure and then data, so it's not a single click thing.