on 2016 May 31 1:04 PM
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
Request clarification before answering.
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 @pathThis could be executed as a batch with ISQL.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
52 | |
6 | |
5 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.