PrepAway - Latest Free Exam Questions & Answers

Which four Transact-SQL statements should you insert at line 07?

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.)

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:

http://technet.microsoft.com/en-us/library/bb510625.aspx

4 Comments on “Which four Transact-SQL statements should you insert at line 07?

  1. Kristina says:

    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);




    0



    0

Leave a Reply