Run a sql server backup
I have a simple app that deletes a bunch of data based on a date selection. I would like to add the ability to run a backup before deleting any data. I have tried a number of things with no luck.
I am using IIS 7 and SQL server 2008 R2
I am currently trying this but have tried many other ways:
DB::unprepared(DB::raw("BACKUP DATABASE MyDB TO DISK = 'D:\backup.bak'"));
If I run this via MS SQL server management studio it works great. It fails when I try to run it from my laravel app.
The SQL error logs tell me to look at my apps log form more information. I also see a schannel error that seems to be associated with ssl certificate but I am unsure if this is related as I am using http:
I am getting NULL back from sqlsrv_erros() but am new to laravel and am unsure if this works as I expect it to.
Any help is appreciated.
Please or to participate in this conversation.