SQL2000 regular backup to a different machine

Source: Internet
Author: User
Enterprise Manager
-- Manage
-- SQL Server proxy
-- Right-click a job
-- Create a job
-- Enter the job name in "general"
-- "Step"
-- New
-- Enter the step name in "Step name"
-- Select "Transact-SQL script (tsql)" in "type )"
-- "Database": select the database for Command Execution
-- Enter the statement to be executed in "command:
Declare @ strsql varchar (1000)
Declare @ strdirname varchar (50)
Declare @ strcmd varchar (50)
Declare @ strsend varchar (1000)
Declare @ strdate varchar (50)
Exec master.. xp_mongoshell 'net use // 192.168.0.151/d $ password/User: 192.168.0.151/Administrator'
Set @ strsql = 'backup database new_his to disk = ''// 192.168.0.151/d $/serverd /'
Set @ strdirname = Replace (substring (convert (varchar (20), getdate (), 120),), '-', '') + '12'
Set @ strcmd = 'md // 192.168.0.151/d $/serverd /'
Set @ strcmd = @ strcmd + @ strdirname
Exec master .. xp_mongoshell @ strcmd
-- Print @ strsql
Set @ strsql = @ strsql + @ strdirname + '/new_hisbackup.dat' with init, nounload, noskip, noformat'
-- Print @ strsql
Exec (@ strsql)

---- The IP address and shared directory written here must be modified by the user, and the password must be correct.

-- OK
-- "Scheduling" item
-- Create Scheduling
-- Enter the scheduling name in "name"
-- Select your job execution schedule in "scheduling type"
-- If "repeated appears" is selected"
-- Click "change" to set your schedule


Then start the SQL Agent service and set it to Automatic startup. Otherwise, your job will not be executed.

Setting method:
My computer -- control panel -- Administrative Tools -- service -- Right-click SQLServerAgent -- properties -- start type -- select "auto start" -- OK.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.