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
5-4-3-8
https://msdn.microsoft.com/es-es/library/bb510625.aspx can help
MERGE CountryRegion AS target
USING (SELECT @CountryRegioncode, @Name)
AS source(CountryRegioncode, Name)
ON (target.CountryRegionCode=source.Countryregioncode)
WHEN MATCHED THEN UPDATE SET Name=source.Name
WHEN NOT MATCHED BY TARGET THEN
INSERT (Countryregioncode, Name)
VALUES (source.CountryRegioncode, source.Name);
Correct