Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Importare un DB da SQL 2000 a SQL 2005 Express

363 views
Skip to first unread message

Destro

unread,
Feb 1, 2006, 12:35:27 PM2/1/06
to
Salve,
sto cercando di importare un DB di SQL Serve 2000 su un SQL 2005 Express
Ho letto che in teoria dovrebb essere semplicissimo. Ecco come procedo:
Faccio un Backup dal SQL 2000... credo un DB con lo stesso nome su SQL 2005
(su un altra macchina) ed effettuo il restore del file di backup
Qui di seguito l'errore che esce... mi da lo stesso errore con tutti i DB
che ho tentato di importare... dove sbaglio?
Grazie
Andrea

TITLE: Microsoft SQL Server Management Studio Express
------------------------------

Restore failed for Server 'MELKIOR\SQLEXPRESS'.
(Microsoft.SqlServer.Express.Smo)

For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: The backup set holds a backup of a database
other than the existing 'DlpDB' database. (Microsoft.SqlServer.Express.Smo)

For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&LinkId=20476

Marcello

unread,
Feb 1, 2006, 12:40:50 PM2/1/06
to
Destro ha scritto:
> Salve,

Ciao,

> sto cercando di importare un DB di SQL Serve 2000 su un SQL 2005 Express
> Ho letto che in teoria dovrebb essere semplicissimo. Ecco come procedo:
> Faccio un Backup dal SQL 2000...

ok

> credo un DB con lo stesso nome su SQL 2005 (su un altra macchina)

?? perchè, il restore crea il db che serve.

> ed effettuo il restore del file di backup

ok

prova senza creazione del db.

marc.

Destro

unread,
Feb 1, 2006, 12:55:00 PM2/1/06
to

"Marcello" ha scritto:

ok...ho cancellato il DB e ho fatto il restore dal file e mi da quest'altro
errore:


TITLE: Microsoft SQL Server Management Studio Express
------------------------------

Restore failed for Server 'MELKIOR\SQLEXPRESS'.
(Microsoft.SqlServer.Express.Smo)

------------------------------
ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: Directory lookup for the file "C:\Program
Files\Microsoft SQL Server\MSSQL\data\DlpDB_Data.MDF" failed with the
operating system error 3(The system cannot find the path specified.).

Lorenzo Benaglia

unread,
Feb 1, 2006, 3:27:19 PM2/1/06
to
Destro wrote:
> ok...ho cancellato il DB e ho fatto il restore dal file e mi da
> quest'altro errore:

Ciao Destro,

i suggerimenti proposti da marcello sono esatti, è sufficiente fare un
banale full backup del database SQL Server 2000 ed eseguire il relativo
restore sull'istanza SQL Server 2005.

Guarda questo esempio:

Apro una connessione con Query Analyzer ad una istanza SQL Server 2000

/***************************/
/* Istanza SQL Server 2000 */
/***************************/

/* 1) Eseguo un full backup del database Northwind */
BACKUP DATABASE Northwind
TO DISK = 'C:\Nwind.bak';
GO

/* Output:

Processed 376 pages for database 'Northwind', file 'Northwind' on file 1.
Processed 1 pages for database 'Northwind', file 'Northwind_log' on file 1.
BACKUP DATABASE successfully processed 377 pages in 0.151 seconds (20.405
MB/sec).

*/

/* 2) Copio il file C:\Nwind.bak sul server che ospita SQL Server 2005 */

Ora mi sposto sul server di destinazione con SQL Server 2005 e da SQL Server
Management Studio Express provvedo ad effettuare il restore:

/***************************/
/* Istanza SQL Server 2005 */
/***************************/

/* 3) Effettuo il restore */
RESTORE DATABASE Northwind
FROM DISK = 'C:\Nwind.bak'
WITH
MOVE 'Northwind' TO 'C:\northwnd.mdf',
MOVE 'Northwind_log' TO 'C:\northwnd.ldf';
GO

/* Output:

Processed 376 pages for database 'Northwind', file 'Northwind' on file 1.
Processed 1 pages for database 'Northwind', file 'Northwind_log' on file 1.

*/

Come vedi nel comando RESTORE sono andato a specificare la clausola WITH
MOVE che ti permette di specificare un nuovo path dei file fisici che
costituiscono il database.
Dato che di default le due versioni di SQL Server utilizzano path differenti
per memorizzare tali files, sei costretto a specificare la clausola WITH
MOVE se non vuoi incorrere nel messaggio d'errore che hai segnalato.

Ciao!

--
Lorenzo Benaglia
Microsoft MVP - SQL Server
http://blogs.dotnethell.it/lorenzo
http://italy.mvps.org


Destro

unread,
Feb 1, 2006, 4:11:28 PM2/1/06
to

"Lorenzo Benaglia" ha scritto:

Grazie mille!! .... tutto perfetto :)
Andrea

0 new messages