cancel
Showing results for 
Search instead for 
Did you mean: 

Client Side Backup

Former Member
0 Kudos
1,773

Hi all

I am trying to create a batch file that will create a folder of todays date, then backup the db file to that folder, something along the lines of..

setlocal enableextensions
set name=%DATE:/=_%
mkdir %name%
dbbackup -c "uid=DBA;pwd=SQL;dbn=BrewMasterWorld" %name%

Appreciate any guidance on this

Thanks

C

Accepted Solutions (0)

Answers (1)

Answers (1)

reimer_pods
Participant

IMHO that looks ok, but you might want to add the eng={enginename} parameter to the connection string.

Another approach would use an SQL statement for that purpose:

 
create variable @path varchar(127);
set @path= String('C:\\Backup\\',dateformat(today(),'mm_dd_yyyy'));
backup database directory @path
This could be executed as a batch with ISQL.