I have copied the data and log files from SL7.0 from one PC and saved them to CD.
When rebuilding the PC I resaved them into the correct 'Data' folder assuming SQL7.0 would recognise them upon opening. Alas no. Anyone any ideas?
Cheers
| SitePoint Sponsor |



I have copied the data and log files from SL7.0 from one PC and saved them to CD.
When rebuilding the PC I resaved them into the correct 'Data' folder assuming SQL7.0 would recognise them upon opening. Alas no. Anyone any ideas?
Cheers



I personally have no idea there...
But other good sites for SQL7.0 include www.dbforums.com -- maybe you can get an idea or two there...
I personally would have backed up the database, copy backup file to CD then on the new box created a database and restored from CD file.
However something tells me you have no access to the original database anymore - just the files.
So, I guess check out CREATE DATABASE - expecially the FOR ATTACH parameters.
Eh, hope there is a FOR ATTACH option in SQL 7 - as I am using SQL 2000.
Stefan
http://www.aspcode.net - articles on ASP/ASP.NET
http://www.findfreefonts.net - jquery/ajax experiment site

Have a look in SQL Server's Books Online help for sp_attach_db. This will let you re-attach the files to the new server.
Extra tip: make sure the files didn't get made read-only when you copied them to CD!
HTH
Veronica


The biggest problem I see is the read-only one which veronicay rightly points out. Check that this is not read only, then in SQL Query Analyzer use:
However, did you use sp_detach_db before you copied the files to the CD? If not, and it's not a read-only problem, then unfortunately you might have no way of accessing the db.Code:sp_attach_db @dbname = 'dbname', @filename1='c:\dbfilelocation\name.mdf', @filename2='c:\logfilelocation\name.ldf'![]()
Life Goggles - The Entertaining Environment Blog
http://www.lifegoggles.com

Joel's reply is spot-on -- I was too lazy to look up the exact syntax!
If the source SQLServer wasn't running when you copied the db files (i.e. it was stopped), you should be OK even if you didn't use sp_detatch_db.



Cheers guys.....worked a treat!!!
Bookmarks