Quantcast
Channel: Getting started with SQL Server forum
Viewing all articles
Browse latest Browse all 9243

Attaching a database without its log file

$
0
0

Hello All,

I am trying to attach a database without its log file using the below command.

"CREATE DATABASE TestDb ON
(FILENAME =N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TestDb.mdf')
FOR ATTACH_REBUILD_LOG
GO
"

I am getting the below mentioned error..

File activation failure. The physical file name

"C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\AdventureWorksDW2012_log.ldf"

may be incorrect.The log cannot be rebuilt when the primary file is read-only.

Msg 1813, Level 16, State 2, Line 1Could not open new database 'TestDb'. CREATE DATABASE is aborted.

please assist.

Thanks in advance



Thanks and Regards, Readers please vote for my posts if the questions i asked are helpful.


Viewing all articles
Browse latest Browse all 9243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>