Hi,
I'm trying to set up SQL Server Transactional Replication, but I'm encountering an "Access Denied" error during the Snapshot Agent's operation. The replication process is supposed to create a snapshot of the database, but it fails with the following error:
Error messages:
Source: mscorlib
Target Site: Void WinIOError(Int32, System.String)
Message: Access to the path 'C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\ReplData\unc\DESKTOP-3UGIOTT_CAMPUSNET2_PUB_CAMPUSNET\20240824192740' is denied.
Stack: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at Microsoft.SqlServer.Replication.Utilities.CreateDirectoryWithExtendedErrorInformation(String directory)
at Microsoft.SqlServer.Replication.Snapshot.SnapshotProvider.CreateSnapshotFolders()
at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: mscorlib, Error number: 0)
Get help: http://help/0
I've checked the permissions for the directory in question (C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\ReplData
) and made sure that the MSSQLSERVER
service has full control. However, the error persists.Steps Taken So Far:
Verified folder permissions for MSSQLSERVER
and SYSTEM
accounts.
Tried restarting the SQL Server Agent and the Snapshot Agent.
Checked the SQL Server Agent log for additional details.
I'm looking for guidance on how to resolve this "Access Denied" error so that the Snapshot Agent can successfully create the snapshot and proceed with the replication process.