Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 4729

Unable to access D:\ drive in SQL Server

$
0
0

I have two drives in SQL Server Box. C and D drives. I am using below script to move mdf and log files from C: drive to D: Drive. However, I keep getting error : Directory lookup for the file "D:\Packages\TestVGR.mdf" failed with the operating system error 5(Access is denied.).

USE MASTER;
GO
-- Take database in single user mode -- if you are facing errors
-- This may terminate your active transactions for database
ALTER DATABASE TestVGR
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
GO
-- Detach DB
EXEC MASTER.dbo.sp_detach_db @dbname = N'TestVGR'
GO


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

CREATE DATABASE TestVGR ON
( FILENAME = N'D:\Packages\TestVGR.mdf' ),
( FILENAME = N'D:\Packages\TestVGR_log.ldf' )
FOR ATTACH
GO

Please help


Viewing all articles
Browse latest Browse all 4729

Trending Articles



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