码迷,mamicode.com
首页 > 数据库 > 详细

Error "At least one file is needed for database attach" for DB attach

时间:2018-05-22 12:42:55      阅读:316      评论:0      收藏:0      [点我收藏+]

标签:server   targe   log   err   mdf   data   The   cmd   SQ   

While we want to attach a singal .MDF file(without log file) for a DB in SQL SERVER, we will meet the problem "At least one file is needed for database attach" enven if renamed the MDF to the same name with target DB.

 

we can use the cmd as below:

CREATEDATABASE AdventureWorks2008R2 ON

(FILENAME=N‘E:\SQLBI\AdventureWorks2008R2.mdf‘)

FORATTACH

GO

Error "At least one file is needed for database attach" for DB attach

标签:server   targe   log   err   mdf   data   The   cmd   SQ   

原文地址:https://www.cnblogs.com/muzilingling/p/9070627.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!