I have a strange problem. I want to do backup of my data bases via sqlcmd command. If I write all command directly at cmd, everything works properly. If I save it as bat file and run I have error. Why? Command: sqlcmd -S localhost\sqlexpress –i C:\SQL\Scripts\backup-full-insertnexo.sql error: click Okay: okay I would like to add, on 2 laptops works properly and two bad :/

Thanks, Krystian

  • 3
    This looks like an encoding issue. What tool are you using to create the .bat file? – Max Vernon Oct 18 at 13:35
  • You can try to set the Park under ""... – Nikolaus Oct 18 at 14:03
  • 1
    The character in front of S probably looked like a hyphen when you were writing the batch file, but it's not the syntactically valid hyphen character (ASCII code 45) that is expected there. Replace it in a plain-text editor and try again. This doesn't look like a database issue at all. – Andriy M Oct 19 at 7:08
  • The command line that you've provided in your question has the same issue. Only this time the invalid hyphen-looking character is in front of "i". – Andriy M Oct 19 at 7:11