简体   繁体   中英

SQL Server 2008 - Attach mdf without log - Operating system error 5: 5(Access is denied.)

I am trying to attach database without log file.

Attach a SQL Server database with a missing transaction log file

Error on SSMS

在此处输入图片说明

Error on TSL

Msg 5120, Level 16, State 101, Line 1 Unable to open the physical file "....mdf". Operating system error 5: "5(Access is denied.)".

I'm not sa, but I'm in sysadmin role. I'm not really sure what access permission I need. Or is it because the .mdf is corrupted?

在此处输入图片说明

Thank in advance!

That's a bug in the SSMS interface. It can be done using T-SQL. Just don't include the log file in the list of files.

exec sp_attach_db 'dbname', 'filename'

sp_attach_db (Transact-SQL)

以管理员身份启动SQL Server管理器(右键程序,选择“以管理员身份启动”):问题解决!

I am trying to attach database without log file.

Attach a SQL Server database with a missing transaction log file

Error on SSMS

在此处输入图片说明

Error on TSL

Msg 5120, Level 16, State 101, Line 1 Unable to open the physical file "....mdf". Operating system error 5: "5(Access is denied.)".

I'm not sa, but I'm in sysadmin role. I'm not really sure what access permission I need. Or is it because the .mdf is corrupted?

在此处输入图片说明

Thank in advance!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM