SQL Server How to avoid Violation of PRIMARY KEY in delete\insert transaction?

前端 未结 0 504
星月不相逢
星月不相逢 2021-02-20 01:18

I have pretty simple T-SQL query

DELETE FROM my_table
WHERE [id] = @Id

INSERT INTO my_table
    ([id], [payload])
VALUES
    (@Id, @Payload)

A l

相关标签:
回答
  • 消灭零回复
提交回复
热议问题