Using the stored procedure in the database to eliminate redundant data CREATE PROCEDURE sp_mytest ASdeclare @pro varchar (50) declare @mm intdeclare wu Cursor for select distinct product from mytestopen wufetch next from wu into @prowhile @@ fetch_status = 0begin select @ mm = sum ([COST]) from mytest where [product] = @ pro Delete from mytest where [product] = @ pro INSERT INTOMTEST ([Product], [COST]) VALUES (@ pro, @ mm) fetch next from wu inTo @ ProendClose wudeallocate Wugo We can use jobs to update