I am trying to backup a SQL database using the osql command but I am having problems with the syntax. On a normal setup I use:
osql -E -Q " BACKUP DATABASE BESMgmt TO DISK = 'D:\backup\besDBbackup.bak' WITH INIT"
On the current server however the port has been moved off the default 1433. I have created a named pipe called "backupsql" which has the details of the server and port to use, I am unsure how I intergrate this named pipe into my backup. I can use "osql -E -S backupsql" and get a connection with the 1> prompt but the following does not work and just lists the default osql /? output.
osql -E -S backupsql " BACKUP DATABASE BESMgmt TO DISK = 'D:\backup\besDBbackup.bak' WITH INIT"
Can anyone offer any assistance? Im sure it's one of those you either know or you don't scenario's.