how to create backup in sql 6.0 using sql command

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • progvar
    New Member
    • Feb 2008
    • 40

    how to create backup in sql 6.0 using sql command

    Hi all,
    i want to create the backup of sql 6.0 database using sql command
    i used this command
    BACKUP DATABASE test TO DISK = 'E:\test.Bak' but
    it shows the error
    Msg 156, Level 15, State 1
    Incorrect syntax near the keyword 'DATABASE'.


    but when i used this command in sql 7.0 it works fine


    please provide help me
    varinder sharma
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    Hello Varinder,

    I believe you are talking about Micorosft SQL Server. I am moving the thread to SQL Server forum

    Comment

    • shrimant
      New Member
      • Sep 2007
      • 48

      #3
      Code:
      C:\PROGRA~1\MICROS~3\MSSQL\Binn\SQLMAINT -S "Servername" -U "DBusername" -P "passowrd"  -D "Databasename" -BkUpMedia DISK -DelBkUps 2weeks -BkUpDB "Drive:\BackupFilePath"
      Naote that "C:\PROGRA~1\MI CROS~3\MSSQL\Bi nn\SQLMAINT" would change bepending on your SQL server anf binn path.

      Comment

      • progvar
        New Member
        • Feb 2008
        • 40

        #4
        thanks for reply
        i am not understanding your answer please can you breif it

        thanks
        varinder

        Comment

        • OuTCasT
          Contributor
          • Jan 2008
          • 374

          #5
          Code:
          Backup database DBNAME to disk = 'FILEPATH'

          Comment

          • shrimant
            New Member
            • Sep 2007
            • 48

            #6
            Originally posted by progvar
            thanks for reply
            i am not understanding your answer please can you breif it

            thanks
            varinder
            Make a batch file with ".cmd" or ".bat" file and cut paste the following into the batch file with appropriate obvious changes. SQLMAINT is a Sql Server command line utility, which you could make use for UR purpose

            "C:\PROGRA~1\MI CROS~3\MSSQL\Bi nn\SQLMAINT -S "Servername " -U "DBusername " -P "passowrd" -D "Databasena me" -BkUpMedia DISK -DelBkUps 2weeks -BkUpDB "Drive:\BackupF ilePath""

            Comment

            Working...