/****** Script for SelectTopNRows command from SSMS ******/ insert [MyDB].[dbo].[shop_sell] ( [shop_strid], incDays, refreshDT, sell_num ) SELECT [shop_strid], 7, '2019-06-13', 0 FROM [MyDB].[dbo].[LbShops] A where A.biz_type = 1 and not exists ( SELECT shop_strid FROM [MyDB].[dbo].[shop_sell] B where B.shop_strid = A.shop_strid )