DRAG DROP
You create the following stored procedure. (Line numbers are included for reference only.)
You need to ensure that the stored procedure performs the following tasks:
If a record exists, update the record.
If no record exists, insert a new record.
Which four Transact-SQL statements should you insert at line 07? (To answer, move the appropriate
statements from the list of statements to the answer area and arrange them in the correct order.)
Explanation:
http://technet.microsoft.com/en-us/library/bb510625.aspx
Missing the source table but you should still be able to figure this out with the options given.
1) merge CountryRegion as target…
2) when matched then update set name = source.Name…
3) when not matched by target then …
4) insert (CountryRegionCode, Name) values(source.CountryRegionCode, sourceName)
*Source table is included, perhaps in october of 2015 there was another picture.
*when not matched by target is the same as “when not matched”
*”If no record exists, insert a new record” -> “when not matched by source” means that row exists so with this option only update and delete commands are permitted.