You can use sp_attach_db/sp_attach_single_file_db to attach the sql7 datafile.
After execute this ,the sql7 database will be upgraded to sql 2000 and creat a new database in sql 2000
Say your datafile and logfile of that database is located in
d:\test_data.mdf and d:\test_log.ldf.The query shoudl be
Thanks for the reply. I was able to do what I wanted to do by simply restoring a backup of the SQL 7 database into the SQL2k installation. But I was not aware of sp_attach_db system proc.
The other is restore the backup file with replace in sql2000.
Say your database in sql7.0's mdf and ldf files are located in
D:\MSSQL7\data\x.mdf for databafile
D:\MSSQL7\data\x_log.LDF for lofgile
and the name of datafile is 'x' and name for log file is 'x_log'
You can first backup this database to a backupdevice or any disk path.Then in sql2000 query analyzer execute the following query
restore database x from disk='d:\xbackup.bak' with replace,
move 'x' to 'd:\x_data.mdf',
move 'x_log' to 'd:\x_log.ldf'
Here I backed up the database to disk = 'd:\xbackup.bak' and move the mdf and ldf file to new location for easy management.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.