大量update

  • 168
  • 0

大量update

MERGE INTO [dbo].[BulkTable] [bt]
USING @UpdatedTable [ut]
ON [bt].[Id] = [ut].[Id]
    WHEN MATCHED
    THEN UPDATE SET [Text] = [ut].[Text]
    WHEN NOT MATCHED
    THEN INSERT VALUES ([ut].[Id], [ut].[Text]);

https://dotblogs.com.tw/supershowwei/2016/12/30/154257