1

I have tried to run the following command on my server that is using sql 2008 merge replication

sp_addscriptexec MyPub, '\\my-server\MSSQL\updateTablePermissions.sql', 1

and I get the following error message

Msg 21330, Level 16, State 1, Procedure sp_MSreplcopyscriptfile, Line 40

Cannot create a sub-directory under the snapshot folder (if not exist "\my-server\mssql\repldata\unc\my-server_my_db_MyPub\UserScripts" md "\my-server\mssql\repldata\unc\my-server_my_db_MyPub\UserScripts"). Ensure that there is enough disk space available, and that the account under which the Snapshot Agent runs has permissions to create a sub-directory under the snapshot folder.

There is plenty of space, and my snapshots run with no problem. I'm sure I am missing something simple, but for the life of me I don't see it. A similar command was run on the parent to this server with no problems.

PlTaylor
  • 1,077

1 Answers1

0

This is most likely a permissions issue.

According to sp_addscriptexec, to use sp_addscriptexec, the SQL Server service account must have read and write permissions on the snapshot location and read permissions on the location where any scripts are stored.

To use sp_addscriptexec, the SQL Server service account must have read and write permissions on the snapshot location and read permissions on the location where any scripts are stored.

Please verify your SQL Server service account has read and write permissions on the snapshot directory and try again.