Backup SQL Server database using PHP
问题 I am trying to backup a MS SQL database calling a Stored Procedure using PHP. When I execute de SP on SSMS, everything works fine. However, when I call it from the PHP script, I can see a ".bak" in the backup folder and right after the PHP finishes processing, the BackUp.bak file disappears. Here is the Stored Procedure: DECLARE @date VARCHAR(10) SET @date = (SELECT date FROM tbl_date) Declare @fileName VARCHAR(100) SET @fileName = ('C:\db_backup\BackUp_' + @date + '.bak') BACKUP DATABASE