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.