|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 12:25 PM
Points: 7,110,
Visits: 7,184
|
|
Comments posted to this topic are about the item Repairing with DBCC CHECKDB
Tom Is minic a gheibheann béal oscailte dorn dúnta. Is minig a cheapas beul fosgailte dòrn dùinte.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 3:27 AM
Points: 1,864,
Visits: 297
|
|
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.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 3:27 AM
Points: 1,864,
Visits: 297
|
|
| Ah, I see, looked at the wrong SQL-Server version.
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 6:30 AM
Points: 3,192,
Visits: 4,151
|
|
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".
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 7:57 AM
Points: 1,111,
Visits: 1,394
|
|
Got me! Good one, thanks!
Bex
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 12:28 AM
Points: 2,170,
Visits: 3,583
|
|
There is also a forum discussion where Paul Randal has some comments. Check this LINK.
Mohammed Moinudheen
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Yesterday @ 8:31 AM
Points: 3,129,
Visits: 4,312
|
|
Interesting question, thanks Tom.
Haven't used this option since SQL2000. I presume this will eventually become deprecated.
____________________________________________ Space, the final frontier? not any more... All limits henceforth are self-imposed. “libera tute vulgaris ex”
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 2:11 AM
Points: 9,378,
Visits: 6,473
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 9:50 AM
Points: 1,241,
Visits: 347
|
|
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!
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, May 09, 2013 6:24 AM
Points: 184,
Visits: 120
|
|
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 http://www.michael-gilchrist.com There are 10 types of people in the world, those who understand binary and those that don't.
|
|
|
|