How to sechudle job move the active data from one table to another database table in sql

NAVINN T 20 Reputation points
2023-08-11T06:17:11.8533333+00:00

How to schedule a job move the active data from one table to another database table in sql.

SQL Server | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Javier Villegas 905 Reputation points MVP
    2023-08-11T09:54:02.4033333+00:00

    Hello

    There are multiple options.. The one I suggest is to create a script (or stored procedure) to DELETE from the source table using OUTPUT clause so you will be sending the deleted rows to another table which will be defined by you. Use that script on a SQL Agent Job and schedule it to be executed at the time you need

    here is the explanation and some examples of OUTPUT clause (Transact-SQL)

    hope it helps

    Regards

    Javier

    0 comments No comments

  2. LiHongMSFT-4306 31,571 Reputation points
    2023-08-14T02:50:56.6666667+00:00

    Hi @NAVINN T

    How to schedule a job move the active data from one table to another database table in sql.

    Regarding Schedule a Job, please refer to this tech doc: Schedule a Job.

    Regarding move the active data from one table to another database table, you could use SELECT INTO Query. Also, you could use SQL Server Export/Import wizard or use Generate Scripts.

    Please refer to this article for more details: How to copy tables from one database to another in SQL Server.

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.