Create Primary Keys

Before you begin

Execute the SSIS package.

About this task

This topic describes how to create primary keys for the history tables that you have imported to SSIS.

Procedure

Use the following code to add a primary key:
USE  <database name>
GO 
ALTER TABLE <schema name>.<history table name>  
ADD CONSTRAINT <history table name>_PK_Id PRIMARY KEY NONCLUSTERED
(
    <Primary key column name> ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, 
IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) 
ON [PRIMARY]
GO
Tip:
Run the following command to verify the data integrity of the table:
DBCC CHECKTABLE ("<schema name>.<history table name>")

What to do next

Add the history tables to the AWS DMS task.