I'm trying configure best backups pratices in Windows server 2019 using sqlcmd in Windows Schedule Tasks with NT AUTHORITY\SYSTEM account, but it's not working... It only works if a setup this account with sysadmin role, if I setup only with public role I get this error:
Msg 229, Level 14, State 5, Server EC2AMAZ-FFO8O5O, Procedure DatabaseBackup, Line 1
The EXECUTE permission was denied on the object 'DatabaseBackup', database 'master', schema 'dbo'.
I read that to make backups SQL only need to setup public role, is that right? Could someone help me with this?
Microsoft SQL Server 2016 (SP2-CU17) (KB5001092) - 13.0.5888.11 (X64) Microsoft Corporation Express Edition (64-bit) on Windows Server 2019 Datacenter 10.0 <X64>