1. View the logical file name (logical file name) and physical path (operation system file name) of the Northwind database files in SQL Server 2000:
Use nothwindgoselect name, filename, * from Dbo.sysfiles
Name filename-------------- ------------------------------------------------------------------ Northwind d:/program files/microsoft sql Server/mssql$sqla/data/northwnd.mdfnorthwind_log d:/program files /microsoft SQL Server/mssql$sqla/data/northwnd.ldf
2. Backing up a SQL Server 2000.Northwind database
Backup Database Northwind to disk = ' C:/northwind.bak '
3. Restore the Northwind database in SQL Server 2005 Instance.
Use Mastergorestore database Northwind from disk = ' C:/northwind.bak '
4. Correct method for restoring the Northwind database in SQL Server 2005: Restore with Move.
The data files in SQL Server 2005 are located in the following directory: D:/microsoft SQL server/mssql.1/mssql/data/
Restore DATABASE northwind From disk = ' C:/northwind.bak ' with Move ' Northwind ' to ' D:/microsoft SQL Server/mssql.1/ms Sql/data/northwind.mdf ' , move ' northwind_log ' to ' D:/microsoft SQL Server/mssql.1/mssql/data/northwind.ldf '
The Northwind database is restored successfully in SQL Server 2005.
Note that when you restore Northwind in SQL Server 2005, you do not need to first create a Northwind database with the same name, but restore directly.
Another problem is if the customer gives you a Northwind.bak backup file that lets you restore on your own machine. So how do you determine the logical file name in with move? One approach is to ask the customer for access, and the second is to use SQL Server restore filelistonly to view it.
5. Use the SQL Server restore FILELISTONLY command to view the logical file name
You can get a lot of information from the SQL Server restore FILELISTONLY command results, only LogicalName and PhysicalName are listed below.
Restore filelistonly from disk= ' C:/northwind.bak '
LogicalName physicalname--------------- -------------------------------------------------------------- ----Northwind d:/program files/microsoft SQL server/mssql$sqla/data/northwnd.mdfnorthwind_log D:/program Files/microsoft SQL Server/mssql$sqla/data/northwnd.ldf
Reprint: http://blog.csdn.net/fax5201314/article/details/38865151
SQL statement restores unknown logical name database