in Education by
I have an old server with a defunct evaluation version of SQL 2000 on it (from 2006), and two databases which were sitting on it. For some unknown reason, the LDF log files are missing. Presumed deleted. I have the mdf files (and in one case an ndf file too) for the databases which used to exist on that server, and I am trying to get them up and running on another SQL 2000 box I have sitting around. sp_attach_db complains that the logfile is missing, and will not attach the database. Attempts to fool it by using a logfile from a database with the same name failed miserably. sp_attach_single_file_db will not work either. The mdf files have obviously not been cleanly detached. How do I get the databases attached and readable? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I found this answer, which worked with my SQL 2000 machines: How to attach a database with a non-cleanly detached MDF file. Step 1: Make a new database with same name, and which uses the same files as the old one on the new server. Step 2: Stop SQL server, and move your mdf files (and any ndf files you have) over the top of the new ones you just created. Delete any log files. Step 3: Start SQL and run this to put the DB in emergency mode. sp_configure 'allow updates', 1 go reconfigure with override GO update sysdatabases set status = 32768 where name = 'TestDB' go sp_configure 'allow updates', 0 go reconfigure with override GO Step 4: Restart SQL server and observe that the DB is successfully in emergency mode. Step 5: Run this undocumented dbcc option to rebuild the log file (in the correct place) DBCC REBUILD_LOG(TestDB,'D:\SQL_Log\TestDB_Log.LDF') Step 6: You might need to reset the status. Even if you don't, it won't do any harm to do so. exec sp_resetstatus TestDB Step 7: Stop and start SQL to see your newly restored database.

Related questions

0 votes
    I have an old server with a defunct evaluation version of SQL 2000 on it (from 2006), and two ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    As it currently stands, this question is not a good fit for our Q&A format. We expect answers to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I've got a local .mdf SQL database file that I am using for an integration testing project. Everything ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    I'm working on an extension (BHO) for Internet Explorer, and having trouble attaching a .NET delegate to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am writing a powershell script that will automate a dev environment deployment and I've hit a problem ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 11, 2022 in Education by JackTerrance
0 votes
    We have a customer requesting data in XML format. Normally this is not required as we usually just hand ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 20, 2022 in Education by JackTerrance
0 votes
    We have a customer requesting data in XML format. Normally this is not required as we usually just hand ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I have a strange problem. I'm executing insert using prepared statement like this: try (Connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    how can i create a script in which i can search someone number and it will provide me name, country, email ... an excel file format Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    I am using EF for access MS SQL data with help LINQ. How can I get current isolation level ? For ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    An Oracle __________ is a set of tables and views that are used as a read-only reference about the ... Answers, Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    What are Tables and Fields in MSSQL?...
asked Dec 8, 2020 in Technology by JackTerrance
0 votes
    You are working with this XML code snippet from the XML document cars.xml. You need to return the information about the cars ... D.doc("cars.xml")/cars/car[integer(year) > 2000]...
asked Mar 10, 2023 in Technology by JackTerrance
0 votes
    Find the current density of a material with resistivity 20 units and electric field intensity 2000 ... by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
...