SQL Server attaches a database (. mdf) file method that does not have a log file

Source: Internet
Author: User
Tags mssql

Attach the database, you will be reminded to find the log file when attached

According to the above phenomenon there are two sentences can be solved: one: Use MASTER; EXEC sp_detach_db @dbname = ' TestDB '; EXEC sp_attach_single_file_db @dbname = ' TestDB ', @physname = ' D:\Program Files\Microsoft SQL Server\mssql10_50.s Ql2008\mssql\data\testdb.mdf ' notation two: CREATE DATABASE TestDB on (FILENAME = ' D:\Program Files\Microsoft SQL Server\m Ssql10_50.sql2008\mssql\data\testdb.mdf '--Enter the directory where the. mdf file is located) for Attach_rebuild_log to execute any of the syntax in the Query window, you may be prompted with the following prompt: File activation failed. The physical file name ' D:\Program Files\Microsoft SQL Server\mssql10_50.sql2008\mssql\data\testdb.ldf ' may be incorrect. The new log file ' D:\Program Files\Microsoft SQL Server\mssql10_50.sql2008\mssql\data\testdb_log. LDF ' has been created. My understanding is that the original log file name may not match the system naming rules, but at this point the database can be seen with the database file attached.

SQL Server attaches a database (. mdf) file method that does not have a log file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.