Home  >  Article  >  Backend Development  >  Another method to back up and restore Sql server database_PHP tutorial

Another method to back up and restore Sql server database_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:00:23930browse

Directly copy the data files. Copy the database data files (*.mdf) and log files (*.ldf) to the destination server, and use the statement in SQL Server Query Analyzer to restore: EXEC sp_attach_db @dbname = 'test', @filename1 = 'd:mssql7data est_data.mdf', @filename2 = 'd:mssql7data est_log.ldf' In this way, the test database is attached 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 commands: EXEC sp_detach_db @dbname = 'test' EXEC sp_attach_single_file_db @dbname = 'test', @physname = 'd:mssql7data est_data.mdf' The function of this statement is to only load data Files and log files can be automatically added by the SQL Server database, but the data recorded in the original log files will be lost.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631237.htmlTechArticleCopy the data files directly and copy both the database data files (*.mdf) and log files (*.ldf) Go to the destination server and use the statement in SQL Server Query Analyzer to restore: EXEC sp_a...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn