What is MERGE in sql server 2008?
Submitted by: AdministratorMerge statement allows a single statement for INSERT, DELETE and UPDATE a row that depends on a condition. The target table for certain operations is based on the results of join with a source table. The following example illustrates the use of MERGE.
MERGE InventoryMaster AS invmstr
USING (SELECT InventoryID, Descr FROM NewInventory) AS src
ON invmstr. InventoryID = src. InventoryID
WHEN MATCHED THEN
UPDATE SET invmstr.Descr = src.Descr
WHEN NOT MATCHED THEN
INSERT (InventoryID, Descr) VALUES (src. InventoryID, src.Descr);.
Submitted by: Administrator
MERGE InventoryMaster AS invmstr
USING (SELECT InventoryID, Descr FROM NewInventory) AS src
ON invmstr. InventoryID = src. InventoryID
WHEN MATCHED THEN
UPDATE SET invmstr.Descr = src.Descr
WHEN NOT MATCHED THEN
INSERT (InventoryID, Descr) VALUES (src. InventoryID, src.Descr);.
Submitted by: Administrator
Read Online SQL server 2008 Job Interview Questions And Answers
Top SQL server 2008 Questions
☺ | Explain Sparse Columns of sql server 2008? |
☺ | Do you know PowerShell included in SQL Server 2008? |
☺ | Explain how to store and query Spatial Data? |
☺ | What is Change Data Capture (CDC) feature in sql server 2008? |
☺ | Do you know Enhanced database mirroring in sql server 2008? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Sybase Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |