Need help in resolving the issue with backing up a DB using Ola Hallengren's stored procedure to a shared folder.
I have a procedure that is executed at SQL Server startup. It runs Ola Hallengren's
DatabaseBackup procedure. The SQL Server service runs under
The share has permissions for the machine where SQL runs.
Now, if execute
DatabaseBackup manually it goes fine. When it executes automatically at startup it fails with the following error:
Msg 50000, Level 16, State 1, Procedure DatabaseBackup, Line 786 [Batch Start Line 0] The directory \\*** does not exist
If I alter the procedure with an
Execute As DBO clause, it fails with the same error.
I also tried to
Alter the SP with
Execute As Self clause - the same error again.
So the question is:
What should I do to make it work?
- The file path is provided as a UNC path (e.g.
- This is SQL Express, so I don't have access to SQL Agent jobs.
- Therefore, this is a stored procedure configured to run when the SQL Server instance starts up, not a SQL job set to run when SQL Agent starts.