Home  >  Article  >  Database  >  从 mdf ldf 文件恢复sql server 数据库

从 mdf ldf 文件恢复sql server 数据库

WBOY
WBOYOriginal
2016-06-07 14:59:291299browse

欢迎进入Windows社区论坛,与300万技术人员互动交流 >>进入 1: 无需新建数据库,直接运行 USE master; GO CREATE DATABASE test ON (FILENAME = 'D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\test.mdf'), (FILENAME = 'D:\Pr

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

  1: 无需新建数据库,直接运行

  USE master;

  GO

  CREATE DATABASE test

  ON (FILENAME = 'D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\test.mdf'),

  (FILENAME = 'D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\test_log.ldf')

  FOR ATTACH;

  GO

  如需其它文件,复制到相应位置即可

  2: 刷新下就会出来

从 mdf ldf 文件恢复sql server 数据库

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