Moving Data from SQL Server 2000 to SQL Server 2005 - Taking data from SQL 2000 Server
(Page 2 of 4 )
In order to detach a database, expand the Server node in SQL 2000 Server to reveal all the databases. Right click on the database you want to detach, in this case Northwind, and choose All Tasks. From drop-down menu click on Detach Database, as shown in Figure 1 below. Once you detach a database, that node disappears, but the related *.mdf and *.ndf remain where they are.

The Detach Database window opens as shown in Figure 2.

In the above window you can update statistics by placing a check mark. Clicking on OK detaches the database as shown Figure 3. The database files northwind.mdf (DATA) and northwind.ldf (Transaction Log) can be found at:
C:\Program Files\Microsoft SQL Server\MSSQL\Data\northwnd.mdf
C:\Program Files\Microsoft SQL Server\MSSQL\Data\northwnd.ldf
If you want to continue using the Northwind database you will have to attach again. However, since it is also required to move this database to SQL 2005 server, copy these two files before reattaching Northwind to SQL 2000 Server.
Now right click on the Databases node in the Enterprise Manager and choose Attach Database, which opens up the next window, Attach Database - (local).

In this window you will need to look for the file you want to attach. It is important to know the file name and its location. It is also important to know who detached the database. Now click on the Verify... button.

This opens up a search window, Browse for Existing File-(Local), where you can search through your machine to locate the files as shown in the next figure.

In the above window you need to choose northwind.mdf. Both of the files will be attached as shown. The default name of the database node will be the same as the one that existed before detaching. After attaching the database you may carry out your operations with this database, as it becomes visible in the Enterprise Manager.

Next: Parking Data in SQL 2005 Server >>
More MS SQL Server Articles
More By Jayaram Krishnaswamy
|
| · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | | |
|