Insert into where not exists

Time:2022-5-10
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 

 

Recommended Today

A useful widget in the spring framework: Spring retry

1. Overview Spring RetryIs a component in the spring framework,It provides the ability to automatically recall failed operations. This is helpful in situations where errors may occur temporarily, such as transient network failures. In this article, we’ll see various ways to use spring retry: annotations, retrytemplate, and callbacks. 2. Maven dependency Let’s firstspring-retryAdd dependencies to […]