PrepAway - Latest Free Exam Questions & Answers

Which four Transact-SQL statements should you use?

DRAG DROP
You want to add a new GUID column named BookGUID to a table named dbo.Book that already
contains data.
BookGUID will have a constraint to ensure that it always has a value when new rows are inserted
into dbo.Book.
You need to ensure that the new column is assigned a GUID for existing rows.
Which four Transact-SQL statements should you use? (To answer, move the appropriate SQL
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:

Actually, in the real world, you don’t have to use WITH VALUES at the end of the statement and it
works just as well. But because the question specifically states which FOUR TSQL statements to use,
we have to include it.
http://msdn.microsoft.com/en-us/library/ms190273.aspx

4 Comments on “Which four Transact-SQL statements should you use?

  1. Greg says:

    WITH VALUES must be used. If not, the value in the already existing columns would be NULL.

    Quote:
    The following example adds a nullable column with a DEFAULT definition, and uses WITH VALUES to provide values for each existing row in the table. If WITH VALUES is not used, each row has the value NULL in the new column.




    0



    0

Leave a Reply