简体   繁体   English

SQL 服务器作业,用于将数据从数据库复制到另一个数据库

[英]SQL Server job for copying data from a database to another one

I am amateur in SQL Server jobs or procedures and i need to develop a job to copy data from a database to another one.我是 SQL 服务器作业或程序的业余爱好者,我需要开发一项作业以将数据从数据库复制到另一个数据库。 if you know a little example that can help me to create it, i will really thankfull.如果您知道一个可以帮助我创建它的小示例,我将非常感激。

It should be like a function, that someones call the function (by the name) and it automatically copy data from a database to another one.它应该像 function,有人称之为 function(按名称),它会自动将数据从数据库复制到另一个数据库。

  1. Expand the SQL Server Agent node and right click the Jobs node in SQL Server Agent and select 'New Job'展开 SQL Server Agent 节点并右键单击 SQL Server Agent 和 select 'New Job'中的 Jobs 节点

  2. In the 'New Job' window enter the name of the job and a description on the 'General' tab.在“新工作”window 中,在“常规”选项卡上输入工作名称和描述。

  3. Select 'Steps' on the left hand side of the window and click 'New' at the bottom. Select window 左侧的“步骤” ,然后单击底部的“新建”

  4. In the 'Steps' window enter a step name and select the database you want the query to run against.在“步骤”window 中输入步骤名称和 select 您希望运行查询的数据库

  5. Paste in the T-SQL command you want to run into the Command window and click 'OK'.将要运行的T-SQL 命令粘贴到命令 window 中,然后单击“确定”。

    INSERT INTO newTable
    SELECT * FROM oldTable
  1. Click on the 'Schedule' menu on the left of the New Job window and enter the schedule information (eg daily and a time ).单击New Job window 左侧的'Schedule'菜单并输入计划信息(例如每天和时间)。

  2. Click 'OK' - and that should be it.单击“确定”-应该就是这样。

Check the animated gif by S.Mason检查S.Mason的动画 gif

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 每天将数据从一个 SQL 服务器数据库复制到另一个 SQL 数据库 - Copying Data from one SQL Server Database to Another SQL Database on a Daily basis SQL Server将表从一个数据库复制到另一个数据库 - SQL Server Copying tables from one database to another 将数据从一个数据库复制到另一个SQL代码 - Copying Data from One Database to Another SQL code 使用向导将数据库从一台服务器复制到SQL Server 2014中的另一台服务器 - Copying database from one server to another server in sql server 2014 using wizard SQL Server 2008:将所有表的内容从一个数据库复制到另一个数据库 - SQL Server 2008: copying the contents of all tables from one database into another database SQL数据库迁移-性能问题(将数据从一个数据库复制到另一个数据库) - SQL Database Migration - Performance issue (Copying data from one database to another) 将表从一个数据库复制到另一个数据库时,sql server 2008将锁定源表 - will sql server 2008 lock source table while copying table from one database to another SQL Server将数据从一个数据库表复制到另一数据库表 - Sql Server copy data from one database table to another 将SQL Server数据从一个数据库导出到另一个数据库 - Export SQL Server data from one database to another 将数据从一个SQL Server数据库迁移到另一个SQL Server数据库 - Migrating Data from one to another sql server database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM