Export History Tables

Before you begin

Ensure that you have completed the prerequisites.

Procedure

  1. Access SSMS.
  2. Right-click Database, and then select Tasks > Export Data.
    The SQL Server Import and Export Wizard window appears, displaying the Choose a Data Source page
  3. Select a data source:
    1. In the Data Source box, select Microsoft Server OLEDB Driver for SQL Server.
    2. Provide the server name, authentication details, and database name to connect to the database, and then select Next.
      The Choose a Destination page appears.
  4. Select a destination:
    1. In the Destination box, select Flat File Destination.
    2. Provide the path to the history table file that you want to export (for example, <path to the file>/Activity_History-2021-02-24-12-48.txt).
    3. In the Locale box, select English (United States).
    4. In the Text Qualifier box, enter #&TQ&#.
    5. Select the First row has column names check box, and then select Next.
      The Specify Table Copy or Query page appears.
  5. Select Copy data from one or more tables or views, and then select Next.
    The Select Source Tables and Views page appears.
  6. Select the check box for the table that you want to export, and then select Next.
    Tip:
    • You can view the first 100 rows of data in the data source by selecting Preview.
    • You can edit the column mappings between the data source and destination by selecting Edit Mappings.
  7. Select the Execute immediately check box, and then select Next.
    The Save SSIS Package page appears.
  8. Select Next.
    The Complete the Wizard page appears, displaying a summary of the options that you have selected.
  9. Select Finish.
    The history table is exported.

What to do next

Import the SSIS package into SSMS.