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

One Comment on “Which four Transact-SQL statements should you use?

  1. Peter says:

    1) alter table dbo.Book add BookGuid UniqueIdentifier null
    2) constraint DF_BookGuid default
    3) newid()
    4) with values

    * with values sets the defaults {in this case using newid() function} for all existing rows;




    0



    0

Leave a Reply