Insert into where not exists

IF NOT EXISTS (SELECT 1 FROM [dbo].[geo_asso_type] WHERE [geo_asso_type_id] = 11)  
BEGIN 
    INSERT INTO [dbo].[geo_asso_type]   
        ([geo_asso_type_id]  
        ,[bound_asso_type]  
        ,[updated_date])  
    VALUES 
        (11  
        ,'Province to City' 
        ,GETDATE())  
 
END 

 

posted @ 2022-04-08 16:53  极客船长  阅读(195)  评论(0编辑  收藏  举报