Skip to navigation
Upsert for mssql
02.08.16
DECLARE @av8_style varchar(255) ,@av8_code varchar(255) ,@av8_description varchar(255) ,@av8_cost varchar(255) SET @av8_style = '1' SET @av8_code = '2' SET @av8_description = '3' SET @av8_cost = '6' IF EXISTS (SELECT av8_style FROM SL.dbo.F68_av8_other_cost WHERE av8_style = @av8_style) BEGIN UPDATE SL.dbo.F68_av8_other_cost SET av8_code_additional = @av8_code ,av8_description = @av8_description ,av8_cost_for_line = @av8_cost WHERE av8_style = @av8_style --RETURN 1 END ELSE BEGIN Insert into [SL].[dbo].[F68_av8_other_cost] ( av8_style, av8_code_additional, av8_description, av8_cost_for_line ) values( @av8_style ,@av8_code ,@av8_description ,@av8_cost ) --RETURN 1 END
https://wiki.postgresql.org/wiki/UPSERT
Reply
Anonymous
Information Epoch 1732621554
Favor apps that have universal interfaces.
Home
Notebook
Contact us