View, download, and export
Need support with viewing, downloading, and exporting files and folders from your Dropbox account? Find help from the Dropbox Community.
Hi,
I want to backup a SQL Server database using a bat file.
This is the contents of the bat file when I backup it on my laptop :
cls
set SERVERNAME=DESKTOP-6PULTF9\SQLEXPRESS05
set DATABASENAME=AssetManagement
set DATABASESHOP=HuntsmanShop
set datestr=%date:~6,4%%date:~3,2%%date:~0,2%
set timestr=%Time:~0,2%%Time:~3,2%%Time:~6,2%
set FileName=%DATABASESHOP%_%DATABASENAME%_%datestr%%timestr%.bak
set BAK_PATH=C:\Data\Test\
set DEST_FILE=%BAK_PATH%%FileName%
:: --------------------------------------------------
:: BACKUP Database
:: NOTE: If error "access is denied" appear - go to service properties - log on.
sqlcmd -E -S %SERVERNAME% -d master -Q "BACKUP DATABASE [%DATABASENAME%] TO DISK = N'%DEST_FILE%' WITH INIT , NOUNLOAD , NAME = N'%DATABASENAME% backup', NOSKIP , STATS = 10, NOFORMAT"
and this works perfectly.
Now when I want to make a backup to a Dropbox folder it doesn't work :
cls
set SERVERNAME=DESKTOP-6PULTF9\SQLEXPRESS05
set DATABASENAME=AssetManagement
set DATABASESHOP=HuntsmanShop
set datestr=%date:~6,4%%date:~3,2%%date:~0,2%
set timestr=%Time:~0,2%%Time:~3,2%%Time:~6,2%
set FileName=%DATABASESHOP%_%DATABASENAME%_%datestr%%timestr%.bak
set BAK_PATH=C:\Users\miche\Dropbox\Huntsman Shop\Backup\
set DEST_FILE=%BAK_PATH%%FileName%
:: --------------------------------------------------
:: BACKUP Database
:: NOTE: If error "access is denied" appear - go to service properties - log on.
sqlcmd -E -S %SERVERNAME% -d master -Q "BACKUP DATABASE [%DATABASENAME%] TO DISK = N'%DEST_FILE%' WITH INIT , NOUNLOAD , NAME = N'%DATABASENAME% backup', NOSKIP , STATS = 10, NOFORMAT"
I have been looking for a solution for a long time but I can't find it.
What am I doing wrong?
Thanks in advance.
Regards
Michel
Hey @Michel1955 - thanks for using Dropbox and welcome to the Community!
I'm afraid I can't really suggest anything on this, since we usually recommend that people do not sync live databases with Dropbox.
Most databases have remote access methods anyway, so you don't need to sync the live database. You can sync saved snapshots, however, with no issues.
That said, note that I'll leave this thread open in case other users have something additional to offer and you can let us know if you have anything else to ask.
Walter
Community Moderator @ Dropbox
dropbox.com/support
Did this post help you? If so, give it a Like below to let us know.
Need help with something else? Ask me a question!
Find Tips & Tricks Discover more ways to use Dropbox here!
Interested in Community Groups? Click here to join
Hey @Michel1955 - thanks for using Dropbox and welcome to the Community!
I'm afraid I can't really suggest anything on this, since we usually recommend that people do not sync live databases with Dropbox.
Most databases have remote access methods anyway, so you don't need to sync the live database. You can sync saved snapshots, however, with no issues.
That said, note that I'll leave this thread open in case other users have something additional to offer and you can let us know if you have anything else to ask.
Walter
Community Moderator @ Dropbox
dropbox.com/support
Did this post help you? If so, give it a Like below to let us know.
Need help with something else? Ask me a question!
Find Tips & Tricks Discover more ways to use Dropbox here!
Interested in Community Groups? Click here to join
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!