locked
Incorrect syntax near error RRS feed

  • Question

  • Can anyone please advise whats wrong with this command?

    backup database [susdb] to disk =’D:\SUSDB\susdb.bak with copy_only

    Where I underlined I receive an Incorrect syntax near error.

    Setup as below

    Server 2012r2 With SQL Server 2012

     

    Monday, May 8, 2017 9:29 AM

Answers

  • Hello,

    Have you copied the SQL from MS Word or from a web page? It has curly apostrophe ’ instead of straight ones '; try it with

    backup database [susdb] to disk ='D:\SUSDB\susdb.bak' with copy_only


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Monday, May 8, 2017 9:46 AM

All replies

  • Hello,

    Have you copied the SQL from MS Word or from a web page? It has curly apostrophe ’ instead of straight ones '; try it with

    backup database [susdb] to disk ='D:\SUSDB\susdb.bak' with copy_only


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Monday, May 8, 2017 9:46 AM
  • Well, i tried both. Fist copied but then typed in.However only the first bit since my path is different to the one on the document.
    The above suggestion shows no error so this appears to be the issue.
    Quite simple error almost unnoticeable.

    Thanks for the reply.:-)
    Monday, May 8, 2017 9:50 AM