June 14, 2012 at 10:22 pm
Comments posted to this topic are about the item Repairing with DBCC CHECKDB
Tom
June 15, 2012 at 12:18 am
Is the "no repair" answer correct?
http://msdn.microsoft.com/en-us/library/aa258278%28SQL.80%29.aspx
says:
REPAIR_FAST Performs minor, nontime-consuming repair actions such as repairing extra keys in nonclustered indexes. These repairs can be done quickly and without risk of data loss.
June 15, 2012 at 12:19 am
Ah, I see, looked at the wrong SQL-Server version.
June 15, 2012 at 1:01 am
This is a good idea for QOD, unfortunately the QOD itself was ruined by a syntax error. The REPAIR_FAST argument cannot be used without a database name or ID.
http://msdn.microsoft.com/en-us/library/ms176064.aspx
DBCC CHECKDB (Transact-SQL)
Syntax
DBCC CHECKDB
[
[ ( database_name | database_id | 0
[ , NOINDEX
| , { REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST | REPAIR_REBUILD } ]
) ]
[ WITH
{
[ ALL_ERRORMSGS ]
...
}
]
]
When you try to run the command "DBCC CHECKDB , REPAIR_FAST", you get the following error: "Msg 102, Level 15, State 1, Line 1. Incorrect syntax near ','."
The correct syntax is something like "DBCC CHECKDB (AdventureWorks, REPAIR_FAST)" or "DBCC CHECKDB (5, REPAIR_FAST)".
And the correct answer to the QOD is "returns an error message - you have to specify a database".
June 15, 2012 at 1:21 am
Got me! Good one, thanks!
Bex
June 15, 2012 at 2:29 am
This was removed by the editor as SPAM
June 15, 2012 at 2:42 am
When I execute the command given in the question, I get the following error:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ','.
That's because you need to specify the database name in order to use the Repair_Fast option. So I choose answer 1, which was - to my surprise - incorrect.
edit: I see vk-kirov has already said the same thing. Whoopsie.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
June 15, 2012 at 2:49 am
Interesting question and have learnt something today, however I have to agree that the answer is actually wrong, as if you want to add any options to the DBCC command you have to specify the database name - and that in ().
So i would say that the answer should be the Error due to database name being required.
Even adding the database name and once you get the command to actually run, you still get the error that "Repair statement not processed. Database needs to be in single user mode."
If you have that, then you will get the actual answer that has been specified!
I definitely feel we shoudl get a point for the first error at any rate!
June 15, 2012 at 4:35 am
I get: " Incorrect syntax near ','
You have to specify a db name.
Edit:
Heheheh - I see several others have latched onto the incorrect correct answer conundrum too. Mgilchrist = bad 😀
Michael Gilchrist
Database Specialist
There are 10 types of people in the world, those who understand binary and those that don't. 😀
June 15, 2012 at 6:03 am
Apologies to everyone for the silly syntax error.
I'll ask Steve to correct the question.
Tom
June 15, 2012 at 6:29 am
Agree, got the same result as the post above above about syntax error. Is there any quality control on these questions?!?!
June 15, 2012 at 6:45 am
Ugh, I didn't realize that had been depreciated.
Thanks for the question Tom!
June 15, 2012 at 6:58 am
QOD <<FAIL>>
June 15, 2012 at 7:04 am
Since the syntax error due to the comma wasn't one of the choices, I assumed the comma was a typo and answered the question as if it wasn't there. Got it right.
Viewing 15 posts - 1 through 15 (of 30 total)
You must be logged in to reply to this topic. Login to reply