You use a Microsoft SQL Server 2012 database that contains a table named BlogEntry that
has the following columns:
Id is the Primary Key.
You need to append the “This is in a draft stage” string to the Summary column of the recent
10 entries based on the values in EntryDateTime.
Which Transact-SQL statement should you use?
A.
UPDATE TOP(10) BlogEntry
SET Summary.WRITE(N’ This is in a draft stage’, NULL, 0)
B.
UPDATE BlogEntry
SET Summary = CAST(N’ This is in a draft stage’ as nvarchar(max))
WHERE Id IN(SELECT TOP(10) Id FROM BlogEntry ORDER BY EntryDateTime DESC)
C.
UPDATE BlogEntry
SET Summary.WRITE(N’ This is in a draft stage’, NULL, 0) FROM (
SELECT TOP(10) Id FROM BlogEntry ORDER BY EntryDateTime DESC) AS s
WHERE BlogEntry.Id = s.ID
D.
UPDATE BlogEntry
SET Summary.WRITE(N’ This is in a draft stage’, 0, 0)
WHERE Id IN(SELECT TOP(10) Id FROM BlogEntry ORDER BY EntryDateTime DESC)
The only difference between C & D is the 2nd parameter in Write().
– NULL will append to the end.
– 0 will append to the beginning.
0
0
A. works perfectly too
0
0
sorry, C is correct
0
0
The requirement is : recent 10 entries based on the values in EntryDateTime.
A doesn’t guarantee this.
0
0
By the way, part of the new 200Q 70-461 dumps are available here:
https://drive.google.com/open?id=0B-ob6L_QjGLpfnJldlZxTklTaHM0akpJUzhja2pETHJOS0owMzd4eVk1UTVNQUpvdlVxVWM
Best Regards!
0
0
Append by default means to add data to the end of the file, therefore, the C option is correct.
0
0