Home  >  Article  >  Database  >  sql server 如何通过mdf文件和ldf文件恢复数据库

sql server 如何通过mdf文件和ldf文件恢复数据库

WBOY
WBOYOriginal
2016-06-07 15:06:081997browse

欢迎进入Windows社区论坛,与300万技术人员互动交流 >>进入 新建一个查询: 输入指令 USE master; GO ; CREATE DATABASE @DBNAME 在单引号中写上你的mdf文件和ldf文件路径: ON (FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\stu

欢迎进入Windows社区论坛,与300万技术人员互动交流 >>进入

  新建一个查询:

  输入指令

  USE master;

  GO ;

  CREATE DATABASE @DBNAME

  在单引号中写上你的mdf文件和ldf文件路径:

  ON (FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\student_data.mdf'),

  (FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\student_log.ldf')

  FOR ATTACH;

  GO

sql server 如何通过mdf文件和ldf文件恢复数据库

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