2005: BACKUP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RAM

    2005: BACKUP

    Hello,
    I am learning SQL Server 2005. I need to know how to make a backup of
    a database. I tried (according to my book):
    BACKUP DATABASE DemoSQLServer TO DISK = "G:\DemoSQLServ er.bak"
    But I got error:
    Incorrect syntax near 'G:\DemoSQLServ er.bak'.
    Please help.
    Thank you very much.
    /RAM/
  • Erland Sommarskog

    #2
    Re: 2005: BACKUP

    RAM (r_ahimsa_m@poc zta.onet.pl) writes:
    I am learning SQL Server 2005. I need to know how to make a backup of
    a database. I tried (according to my book):
    BACKUP DATABASE DemoSQLServer TO DISK = "G:\DemoSQLServ er.bak"
    But I got error:
    Incorrect syntax near 'G:\DemoSQLServ er.bak'.
    Please help.
    If the book fails, try Books Online.

    Generally, in T-SQL, single quote is used as the string delimiter. (Although
    it is possible with a legacy setting in force also use double quote as
    string delimiter, but this is not recommended.)


    --
    Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

    Books Online for SQL Server 2005 at

    Books Online for SQL Server 2000 at

    Comment

    • NiTiN

      #3
      Re: 2005: BACKUP

      The error is the double quotes! You need to use single quotes to
      specify the filename. The statement should be rewritten as:
      BACKUP DATABASE DemoSQLServer TO DISK = 'G:\DemoSQLServ er.bak'

      N.I.T.I.N.


      RAM wrote:
      Hello,
      I am learning SQL Server 2005. I need to know how to make a backup of
      a database. I tried (according to my book):
      BACKUP DATABASE DemoSQLServer TO DISK = "G:\DemoSQLServ er.bak"
      But I got error:
      Incorrect syntax near 'G:\DemoSQLServ er.bak'.
      Please help.
      Thank you very much.
      /RAM/

      Comment

      • RAM

        #4
        Re: 2005: BACKUP

        On 25 Jul 2006 00:24:24 -0700, "NiTiN" <emailme.nitin@ gmail.com>
        wrote:
        >The error is the double quotes! You need to use single quotes to
        >specify the filename. The statement should be rewritten as:
        >BACKUP DATABASE DemoSQLServer TO DISK = 'G:\DemoSQLServ er.bak'
        Thanks,
        but I have another problem:
        Cannot open backup device 'G:\DemoSQLServ er.bak'. Operating system
        error 5(Access denied.).

        (Changing drive don't help.)
        I have no problem with accessing drives from other applications. I had
        no problems with SQL Server setup.

        Please help.
        /RAM/

        Comment

        • Greg D. Moore \(Strider\)

          #5
          Re: 2005: BACKUP


          "RAM" <r_ahimsa_m@poc zta.onet.plwrot e in message
          news:6lkec292th jpbhkm7b2h03unp eg045jhp2@4ax.c om...
          On 25 Jul 2006 00:24:24 -0700, "NiTiN" <emailme.nitin@ gmail.com>
          wrote:
          >
          The error is the double quotes! You need to use single quotes to
          specify the filename. The statement should be rewritten as:
          BACKUP DATABASE DemoSQLServer TO DISK = 'G:\DemoSQLServ er.bak'
          >
          Thanks,
          but I have another problem:
          Cannot open backup device 'G:\DemoSQLServ er.bak'. Operating system
          error 5(Access denied.).
          >
          (Changing drive don't help.)
          I have no problem with accessing drives from other applications. I had
          no problems with SQL Server setup.
          SQL Server itself for some reason doesn't have access to this drive.

          If it's local, check permissions.

          If it's remote, change it to a UNC path and make sure the user has domain
          priviliges.

          >
          Please help.
          /RAM/
          >

          Comment

          • NiTiN

            #6
            Re: 2005: BACKUP

            but I have another problem:
            Cannot open backup device 'G:\DemoSQLServ er.bak'. Operating system
            error 5(Access denied.).
            >
            (Changing drive don't help.)
            Hi!

            My guess is that you need to grant filesystem privileges to the account
            that SQL Server runs as. That account is usually sysopr.

            N.I.T.I.N.

            Comment

            • RAM

              #7
              Re: 2005: BACKUP

              >My guess is that you need to grant filesystem privileges to the account
              >that SQL Server runs as. That account is usually sysopr.
              I have little experience with Microsoft software...
              On my Windows XP computer I have two accounts Robert (admin) and
              Guest. I have installed SQL Server 2005 on Robert's account. I haven't
              found information about sysopr in BOL nor Internet. Could you help me
              please?
              /RAM/

              Comment

              • RAM

                #8
                Re: 2005: BACKUP

                A few months ago I could create backup using right-click menu, now I
                cannot. What's going on?
                /RAM/

                Comment

                • Erland Sommarskog

                  #9
                  Re: 2005: BACKUP

                  RAM (r_ahimsa_m@poc zta.onet.pl) writes:
                  but I have another problem:
                  Cannot open backup device 'G:\DemoSQLServ er.bak'. Operating system
                  error 5(Access denied.).
                  >
                  (Changing drive don't help.)
                  I have no problem with accessing drives from other applications. I had
                  no problems with SQL Server setup.
                  Is that a local drive or a network drive?

                  Presumably the service account for SQL Server does not have access to
                  this place. Keep in mind that SQL Server is a server application that
                  logs on its own.

                  Start SQL Server Configuraiton Manager. Select "SQL Server 2005 Services".
                  Find the SQL Server service you have problem with. Double-click. Here
                  you can see under which account SQL Server runs. If you change, you will
                  have to restart SQL Server.

                  --
                  Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

                  Books Online for SQL Server 2005 at

                  Books Online for SQL Server 2000 at

                  Comment

                  Working...