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?
-
4Just 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 serverCharlieface– Charlieface2022年02月18日 14:31:47 +00:00Commented Feb 18, 2022 at 14:31
1 Answer 1
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.