Share via

how to schedule an export of a table from sql 2019

Robert Wills 20 Reputation points
Feb 23, 2024, 2:13 AM

I would like to schedule a daily export of a table from SQL 2019 giving it a filename of current date. Thank you

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,494 questions
{count} votes

Accepted answer
  1. Greg Low 1,960 Reputation points Microsoft Regional Director
    Feb 23, 2024, 4:21 AM

    There are other ways but two basic ways:

    • Create and schedule SQL Server Agent job that executes the bcp utility from the command line (or PowerShell) (probably the easiest if you just want a dump of the table data)
    • If you want more control, you could create a SQL CLR stored procedure and just schedule that like any other T-SQL command using a SQL Server Agent job.
    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Olaf Helper 46,546 Reputation points
    Feb 23, 2024, 5:55 AM

    One easy way is to use Integration Services (SSIS) Packages and a scheduled SQL Server-Agent job

    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.