FYP Final Report v1.0.0 
 
Copyright and All Rights Reserved To: Pee-Lo Team @2003/04 
 
79
5. 
To copy out both of the files, we must first stop the SQL server. To do so, close the Query 
Analyzer, then click the red color icon Stop at Service Manager to stop running the SQL 
Server. 
 
6. 
Next, go to both of the location and copy out both of the data file and log file into a 
compact disk. 
 
 
Paste the most-up-to date database to another workstation 
 
1. 
At another workstation, named T-BONE, follow the step 1 until step 4, as shown in Get to 
know your database location, to locate the old data file and log file that we want to 
replace. Do not close the Query Analyzer and also do not stop the SQL server. We still 
need to use them. 
 
By doing so, we know that our old files locations and names are: 
 
E:\MSSQL DATA\peelo_Data.MDF 
 
F:\MSSQL TLog\peelo_Log.LDF 
 
2. 
To replace the old data and log files with the new up-to-date one, we must first detach the 
database by using Query Analyzer as follow: 
use master 
go 
sp_detach_db 'peelo' 
go 
 
3. 
After that go to both of the directory, which you obtain from step 1, to replace the data file 
and log file with the new up-to-date one, from the compact disk. 
 
4. 
Upon successful replacement, we need to use Query Analyzer to re-attach the database 
pointing to the files location as follows: 
use master 
go 
sp_attach_db 'peelo','E:\MSSQL DATA\peelo_Data.MDF','F:\MSSQL 
TLog\peelo_Log.LDF' 
go 
 
5. 
Verify the successful attachment and the file locations using sp_helpfile. You will see the 
same result as getting from step 1 above. 
use peelo 
go 
sp_helpfile 
go 
 
Reassign the security login and user account 
 
1. 
Because we detach, replace, and re-attach the data file and log file manually using Query 
Analyzer, SQL Server will have conflict on mapping the old database security login and 
user account with the new database, although both of the database name, data file, and