About 47,000 results
Open links in new tab
  1. MERGE (Transact-SQL) - SQL Server | Microsoft Learn

    Sep 8, 2025 · The MERGE statement runs insert, update, or delete operations on a target table from the results of a join with a source table.

  2. OUTPUT clause (Transact-SQL) - SQL Server | Microsoft Learn

    The following example captures data returned from the OUTPUT clause of a MERGE statement, and inserts that data into another table. The MERGE statement updates the Quantity column …

  3. Merge WHEN NOT MATCHED BY SOURCE - Microsoft Q&A

    Nov 28, 2020 · Here is a simple example that you can play with. The target table initially has the name of the numbers in Finnish, while the source table has them in English. This particular …

  4. MERGE function - natively compiled stored procedure - SQL Server ...

    Aug 27, 2024 · Use this sample to learn how to simulate the Transact-SQL MERGE statement in a natively compiled module.

  5. Deadlock in Merge Statement in SQL Server - Microsoft Q&A

    Nov 29, 2023 · If there are plenty of other deadlocks on the server, it can take a little time to find this particular deadlock in the output. But the timestamp may help to constrain your search.

  6. Transact-SQL statements - SQL Server | Microsoft Learn

    Nov 22, 2024 · This article summarizes the categories of statements for use with Transact-SQL (T-SQL) in addition to the SELECT statement. You can find all of the statements listed in the …

  7. MERGE Statement results in a Cannot insert duplicate key in object ...

    May 11, 2022 · During the MERGE, it can't see all rows and it would assume some rows are missing and not matched at all, then it will try to insert the row. It's actually the insert that …

  8. Multiple Merge Statements in the Single procedure

    Feb 17, 2021 · A MERGE statement cannot UPDATE/DELETE the same row of the target table multiple times. Refine the ON clause to ensure a target row matches at most one source row, …

  9. OPTION clause (Transact-SQL) - SQL Server | Microsoft Learn

    The following example is a Azure Synapse Analytics SELECT statement that contains a label and multiple query hints. When the query is run on the Compute nodes, SQL Server applies a hash …

  10. WITH common_table_expression (Transact-SQL) - SQL Server

    Jun 25, 2025 · This is derived from a simple query and defined within the execution scope of a single SELECT, INSERT, UPDATE, MERGE, or DELETE statement. This clause can also be …