Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Incorrect syntax in a simple script to backup to UNC

$
0
0

I'm just starting simple for now. I have SQL Server Express 2014 and want to launch the stored procedure to use a UNC. I've tried to a mapped drive using a letter and also @backupLocation=N'\\server\data2\sqlbackup\'

C:\SQLSCRIPTS>sqlcmd -S .\SQLEXPRESS -Q "EXEC sp_BackupDatabases @databaseName='
ROSE', @backupLocation=\\server\data2\sqlbackup\, @backupType='F'"
Msg 102, Level 15, State 1, Server SQLSERVER\SQLEXPRESS, Line 1
Incorrect syntax near '\'.

Or is there a better way like in PS script?

Thank You!


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>