SQL Server database backup restore another party method

Source: Internet
Author: User
Tags copy log sql server query backup
server| Backup | data | Database direct copy of data files copy the data files (*.mdf) and log files (*.ldf) from the database to the destination server and restore the statements in SQL Server Query Analyzer: EXEC sp_attach_db @dbname = ' Test ', @filename1 = ' d:\mssql7\data\test_data.mdf ', @filename2 = ' d:\mssql7\data\test_log.ldf ' This attaches the test database to SQL Server and can be used as usual. If you do not want to use the original log file, you can use the following command: exec sp_detach_db @dbname = ' test ' exec sp_attach_single_file_db @dbname = ' Test ', @physname = ' d:\ Mssql7\data\test_data.mdf ' The function of this statement is simply to load the data file, which can be automatically added by the SQL Server database, but the data recorded in the original log file is lost.

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.