简体   繁体   中英

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. 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.

  1. Expand the SQL Server Agent node and right click the Jobs node in SQL Server Agent and select 'New Job'

  2. In the 'New Job' window enter the name of the job and a description on the 'General' tab.

  3. Select 'Steps' on the left hand side of the window and click 'New' at the bottom.

  4. In the 'Steps' window enter a step name and select the database you want the query to run against.

  5. Paste in the T-SQL command you want to run into the Command window and click 'OK'.

    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 ).

  2. Click 'OK' - and that should be it.

Check the animated gif by S.Mason

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM