Batch backup of mssql database

Source: Internet
Author: User

Error 22022: SQLServerAgent is not currently running. Therefore, you cannot prompt this operation.

The service has been started. I tried to run the job only when I run the SQL statement under the system permission. however, if the permission cannot be downgraded, you can think of batch processing. create a 1.bat and a 1. SQL
Input in bat:Copy codeThe Code is as follows: isql-U sa-P Database Password-I D: \ xx \ 1. SQL

1. Put the backup statement in SQL.Copy codeThe Code is as follows: declare @ filename nvarchar (100) set @ filename = 'd: \ xx '+ convert (char (10), getdate (), 112) print @ filename backup database [database name] to disk = @ filename with noinit, NOUNLOAD, NAME = n' BACKUP ', NOSKIP, STATS = 10, NOFORMAT

If the stored procedure is executed and the system prompts that the stored procedure cannot be found, right-click the database account and select the default database as the database where the stored procedure is located.
Add a plan to the task plan. You can ignore the SQLSERVERAGENT directly.

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.