CREATE TABLE #tmp (
    ShortcutId UNIQUEIDENTIFIER,
    CommandName VARCHAR(255),
    Keys VARCHAR(255),
    FormType VARCHAR(255),
    Context VARCHAR(255),
    StronglyCached BIT,
    UserId UNIQUEIDENTIFIER
);

INSERT INTO #tmp (ShortcutId, CommandName, Keys, FormType, Context, StronglyCached, UserId)
VALUES
    (NEWID(), 'DEBUG_MODE', 'F9, Shift, Control, Alt', NULL, NULL, 0, NULL),
    (NEWID(), 'Просмотр произвольного списка', 'F12', NULL, NULL, 0, NULL),
    (NEWID(), 'Окна...', 'Tab, Control', NULL, NULL, 0, NULL),
    (NEWID(), 'Закрыть', 'W, Control', NULL, NULL, 0, NULL),
    (NEWID(), 'Восстановить вкладку', 'T, Shift, Control', NULL, NULL, 0, NULL),
    (NEWID(), 'Сохранить', 'S, Control', NULL, NULL, 1, NULL),
    (NEWID(), 'Удалить', 'Delete, Shift', NULL, NULL, 1, NULL);

INSERT INTO VCLib.T_SHORTCUTCOMMAND (
    ShortcutId,
    CommandName,
    Keys,
    FormType,
    Context,
    StronglyCached,
    UserId
)
SELECT
    t.ShortcutId,
    t.CommandName,
    t.Keys,
    t.FormType,
    t.Context,
    t.StronglyCached,
    t.UserId
FROM #tmp t
WHERE NOT EXISTS (
    SELECT 1
    FROM VCLib.T_SHORTCUTCOMMAND sc
    WHERE sc.CommandName = t.CommandName
      AND sc.Keys = t.Keys
      AND sc.FormType IS NULL
      AND sc.Context IS NULL
      AND sc.StronglyCached = t.StronglyCached
      AND sc.UserId IS NULL
);

DROP TABLE #tmp;