I have a SQL query written and saved in SSMS that backs up my database. I try to remember to run this every time I leave the program but as memory shrinks with age, I forget enough to concern me.
I would like to incorporate this code into my vb program at the point that I am closing it. I am not sure how to go about this.
I am using VS/VB 2015,Community, SQL Express 2014
This ib the Query:
USE [D:\DATA FILES 092015\DVD_LIST.MDF]
ALTER DATABASE "D:\DATA FILES 092015\DVD_LIST.MDF" SET RECOVERY FULL;
BACKUP DATABASE "D:\DATA FILES 092015\DVD_LIST.MDF" TO DISK = 'G:\DATA FILES\SQLSERVERBackups\DVD_LISTFULLRM.bak' WITH FORMAT;
BACKUP LOG "D:\DATA FILES 092015\DVD_LIST.MDF" TO DISK = 'G:\DATA FILES\SQLSERVERBackups\DVD_LISTFULLRMLog.bak';