


Use T_SQL script to create SQLServer2000 background scheduled job task_PHP tutorial
Author: Jiang Yong http://idoorsoft.51.net
In the database application system, making full use of the back-end server function of the database can simplify the work of the client front-end, and can also reduce the load of the network, and at the same time make The entire system design is more reasonable, making it easier to maintain, transplant and upgrade. Background scheduled task jobs are often used in many database applications, of course in conjunction with stored procedures.
In SQL Server2000, you can manually create a background scheduled task job in the Enterprise Manager step by step, but this is cumbersome and not convenient for publishing. Therefore, this article gives a method to create a job using a T-SQL script.
The following three stored procedures in the SQL Server2000 msdb system library are required to complete the creation of the job. Before doing this, please enable the SQLServerAgent service of the database instance. This service is not enabled by default after SQL Server is installed.
By the way, SQL Server only had an obvious concept of "instance" in version 2000. There was no clear instance in version 7.0, so a default instance was created during the default installation of SQL Server 2000. This is for the sake of peace of mind. SQl Server 7.0 is compatible. If you create an instance by default, the instance name will be empty. What? You don’t know what an “instance” is? I personally went to find some information and found out that Oracle and Sybase both have instances and table spaces, so I called SQL Server before SQL Server 2000 a desktop database.
Getting to the point, the steps are "Job" -> "Job Scheduling" -> "Job Step", as follows:
1. Use sp_add_job to add a new job executed by the SQLServerAgent service.
2. Use sp_add_jobschedule to create job schedule.
3. Use sp_add_jobstep to add a step (operation) to the job
The following takes the script in the bus terminal ticketing system as an example to give a practical example. Before looking at the example, please take a look at the above three Help for system stored procedures. In the example, a custom stored procedure "tksp_bakdata" is used, its function is to process the ticket sales data before the day (just know that it is a custom stored procedure).
Example 1: Process ticket sales data at 0:30 every day
www.knowsky.com
use msdb
EXEC sp_add_job @job_name = 'tk_bakdata',
@enabled = 1,
@description = 'Process ticketing data at 00:30 every day',
@start_step_id = 1,
@owner_login_name = 'tkuser'
exec sp_add_jobserver @job_name = 'tk_bakdata'
go
EXEC sp_add_jobschedule @job_name = 'tk_bakdata',
@name = 'Bakdata003000',
@freq_type = 4,
@freq_interval = 1,
@active_start_time = 003000
go
EXEC sp_add_jobstep @job_name = 'tk_bakdata',
@step_name = 'bakdata',

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











HQL and SQL are compared in the Hibernate framework: HQL (1. Object-oriented syntax, 2. Database-independent queries, 3. Type safety), while SQL directly operates the database (1. Database-independent standards, 2. Complex executable queries and data manipulation).

MetaMask (also called Little Fox Wallet in Chinese) is a free and well-received encryption wallet software. Currently, BTCC supports binding to the MetaMask wallet. After binding, you can use the MetaMask wallet to quickly log in, store value, buy coins, etc., and you can also get 20 USDT trial bonus for the first time binding. In the BTCCMetaMask wallet tutorial, we will introduce in detail how to register and use MetaMask, and how to bind and use the Little Fox wallet in BTCC. What is MetaMask wallet? With over 30 million users, MetaMask Little Fox Wallet is one of the most popular cryptocurrency wallets today. It is free to use and can be installed on the network as an extension

Cloud storage has become an indispensable part of our daily life and work nowadays. As one of the leading cloud storage services in China, Baidu Netdisk has won the favor of a large number of users with its powerful storage functions, efficient transmission speed and convenient operation experience. And whether you want to back up important files, share information, watch videos online, or listen to music, Baidu Cloud Disk can meet your needs. However, many users may not understand the specific use method of Baidu Netdisk app, so this tutorial will introduce in detail how to use Baidu Netdisk app. Users who are still confused can follow this article to learn more. ! How to use Baidu Cloud Network Disk: 1. Installation First, when downloading and installing Baidu Cloud software, please select the custom installation option.

NetEase Mailbox, as an email address widely used by Chinese netizens, has always won the trust of users with its stable and efficient services. NetEase Mailbox Master is an email software specially created for mobile phone users. It greatly simplifies the process of sending and receiving emails and makes our email processing more convenient. So how to use NetEase Mailbox Master, and what specific functions it has. Below, the editor of this site will give you a detailed introduction, hoping to help you! First, you can search and download the NetEase Mailbox Master app in the mobile app store. Search for "NetEase Mailbox Master" in App Store or Baidu Mobile Assistant, and then follow the prompts to install it. After the download and installation is completed, we open the NetEase email account and log in. The login interface is as shown below

Title: Realme Phone Beginner’s Guide: How to Create Folders on Realme Phone? In today's society, mobile phones have become an indispensable tool in people's lives. As a popular smartphone brand, Realme Phone is loved by users for its simple and practical operating system. In the process of using Realme phones, many people may encounter situations where they need to organize files and applications on their phones, and creating folders is an effective way. This article will introduce how to create folders on Realme phones to help users better manage their phone content. No.

Xiaomi car software provides remote car control functions, allowing users to remotely control the vehicle through mobile phones or computers, such as opening and closing the vehicle's doors and windows, starting the engine, controlling the vehicle's air conditioner and audio, etc. The following is the use and content of this software, let's learn about it together . Comprehensive list of Xiaomi Auto app functions and usage methods 1. The Xiaomi Auto app was launched on the Apple AppStore on March 25, and can now be downloaded from the app store on Android phones; Car purchase: Learn about the core highlights and technical parameters of Xiaomi Auto, and make an appointment for a test drive. Configure and order your Xiaomi car, and support online processing of car pickup to-do items. 3. Community: Understand Xiaomi Auto brand information, exchange car experience, and share wonderful car life; 4. Car control: The mobile phone is the remote control, remote control, real-time security, easy

Go language is a simple, efficient, and highly concurrency programming language. It is an open source language developed by Google. In the Go language, the use of spaces is very important, it can improve the readability and maintainability of the code. This article will introduce how to use spaces correctly in Go language and provide specific code examples. Why you need to use spaces correctly In the programming process, the use of spaces is very important for the readability and beauty of the code. Appropriate use of spaces can make code clearer and easier to read, thus reducing

Zhongguancun News: On the morning of April 18, Huawei suddenly announced that the P70 series of mobile phones are officially on sale under the Pioneer Plan. Friends who want to buy should be prepared to take action. According to past practice, Huawei's flagship mobile phones are very popular and will always be out of stock. . This time the Huawei P70 series has been renamed Pura, which means pure. Previously, Huawei's Yu Chengdong said: Since 2012, Huawei's P series smartphones have been like loyal partners, accompanying hundreds of millions of users around the world to spend countless precious moments and jointly witness the beauty and excitement of life. He deeply felt that the trust and love given by every user who chooses Huawei's P series is tantamount to a powerful driving force, always inspiring Huawei to move forward firmly on the road of innovation. Pura means pure.
