• Another issue that may affect performance, a data type mismatch. In the DDL you provided SN is declared differently between the two tables:

    [dbo].[Test_completedUnit]

    [SN] [varchar](50) PRIMARY KEY NOT NULL,

    [dbo].[Test_assemblyQC]

    [SN] [nvarchar](16) NOT NULL,

    In the first table it is declared as varchar(50) and the second nvarchar(16). This results in an implicit data conversion to nvarchar. Any indexes on the SN column will be ignored.