March 12, 2015 at 3:43 am
robert.diley (3/10/2015)What it does log are page deallocations:
"The DELETE statement removes rows one at a time and records an entry in the transaction log for each deleted row. TRUNCATE TABLE removes the data by deallocating the data pages used to store the table data and records only the page deallocations in the transaction log."
Which is why TRUNCATE will always fail if a foreign key is defined. It's operating at page level, not row level, so has no idea what values are in individual rows and hence whether deleting them would break a foreign key constraint. Therefore it disallows the operation regardless of the data.
March 12, 2015 at 7:47 am
Now we got the point I think.
--------------------------------------
;-)“Everything has beauty, but not everyone sees it.” ― Confucius
March 16, 2015 at 3:48 am
or
Drop table BBB
Presume question author made a mistake in sintax, main reason why majority did not accept the answer 'D' as correct solution.
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*Brevity is the soul of wit.
March 17, 2015 at 4:41 am
Same here, immediately discounted d) as the TSQL was incorrect.
April 1, 2015 at 5:33 am
chgn01 (3/12/2015)
Now we got the point I think.
There is no point in writing incorrect syntax & then marking it as correct answer.
April 9, 2015 at 11:33 pm
d can not be the answer as it is having syntax error. Only correct answer is f.
If you run the statement it gives the below error:
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'table'.
April 20, 2016 at 7:04 am
I'm going back over old questions I missed. This question is one that I am dealing with a lot lately. It had good info. Thanks.
Viewing 7 posts - 46 through 51 (of 51 total)
You must be logged in to reply to this topic. Login to reply