萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> mssql數據庫 >> 從mdf|ldf文件恢復sqlserver數據庫

從mdf|ldf文件恢復sqlserver數據庫

   1: 無需新建數據庫,直接運行

  USE master;

  GO

  CREATE DATABASE test

  ON (FILENAME = 'D:Program FilesMicrosoft SQL ServerMSSQL10.MSSQLSERVERMSSQLDATAtest.mdf'),

  (FILENAME = 'D:Program FilesMicrosoft SQL ServerMSSQL10.MSSQLSERVERMSSQLDATAtest_log.ldf')

  FOR ATTACH;

  GO

  如需其它文件,復制到相應位置即可

  2: 刷新下就會出來

copyright © 萬盛學電腦網 all rights reserved