0

I have a SQL Server that is running under Windows. And I have a Linux client. AFAIK SQLCMD requires "local" (server-related) path to backup files. So the question is - how to specify windows paths (e:\backups\db_name\etc) under Linux shell or script? Do I need to dublicate backslashes? Or can I use forward slashes?

1
  • 4
    Just use normal Windows file names. The batch is sent directly to the server anyway. You cannot access your Linux client anyway, the path is local to the server Feb 18, 2022 at 14:31

1 Answer 1

0

If you are in an interactive sqlcmd session, no need to escape the backslashes. However, if you use the -Q parameter to execute your backup or restore command, you'll have to double the backslashes, as the string will first be interpreted by the shell before sending it to sqlcmd.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.