我不太了解如何使用合并语句,我需要将以下内容翻译成等效的合并语句。合并比更新/插入更快吗?
ALTER PROCEDURE [dbo].[IOUUS]
@a VARCHAR(50),
@b VARCHAR(50),
@c NVARCHAR(4000)
AS
BEGIN
IF EXISTS (
SELECT c
FROM T
)
UPDATE T
SET c = @c
, d = GETUTCDATE()
WHERE b = @b AND a = @a
ELSE
INSERT INTO T (a, b, c, d)
VALUES (@a, @b, @c, GETUTCDATE())
END