Restoring SQL Server database on Windows instance from Linux SQLCMD



  • 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?



  • 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.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2