the below query should solve your problem. implement and let me know your comments
CREATE TABLE dbo.table1(
PolicyNum INT,
RecordID INT,
SequenceID int
)
CREATE TABLE dbo.table2(
RecordIDINT,
CompanyID INT,
Total int
)
INSERT INTO table1 VALUES (123456, 456,...