June 15, 2012 at 7:18 am
The question specifically states 2008+ and on 2008 the syntax is invalid. The first answer is the correct answer, not the answer you indicate.
June 15, 2012 at 7:43 am
Got me on this one because I read an old version of BOL. I knew there was a syntax error but I focused only on the words and not the punctuation.
I should pay attention to versions in later QOTDs.:-D
Happy weekend everyone!!!
"El" Jerry.
June 15, 2012 at 7:56 am
I got this one wrong (or right) because my answer assumes that DBCC CheckDB requires a database name, and in parentheses. At any rate, I didn't get the point but it was nice to brush up on some SQL history.
Thanks.
June 15, 2012 at 8:29 am
in SQL 2012 running this you will get a syntex error near ","
June 15, 2012 at 8:30 am
I got this right because my copy of Local Transact SQL Help says as does BOL
' database_name ' | database_id | 0
Is the name or ID of the database for which to run integrity checks. If not specified, or if 0 is specified, the current database is used. Database names must comply with the rules for identifiers.
REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST | REPAIR_REBUILD
Specifies that DBCC CHECKDB repair the found errors. The specified database must be in single-user mode to use one of the following repair options.
I read it such that if you don't specify a database it will default to the current one. I guess not with the REPAIR commands?
Originally I thought it was an error... but reading that it seems that it should be right... it's not... but I think it should be.
June 15, 2012 at 9:21 am
The typo has been corrected and points awarded back.
My apologies for the typo.
June 15, 2012 at 9:28 am
As a point of intellectual curiosity, when I run this against my sandbox database (SQL 2008 R2) I get an error that the database needs to be in single user mode.
Thanks again for everything. I start every morning with the SSC QoTD, and it has taught me an awful lot.
Andre Ranieri
June 15, 2012 at 9:34 am
Thanks for the question - cheers
June 15, 2012 at 11:01 am
Good question. I knew it wasn't valid any more but had forgotten that it wouldn't error.
June 18, 2012 at 11:18 am
Thanks Tom.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
June 18, 2012 at 11:29 am
Easy one and no repairs would be done in this case.
Thanks.
June 19, 2012 at 2:14 am
Am I allowed to complain that I got an error because I have no such database as Adventureworks? 😉
I knew that repair_fast no longer worked, but guessed wrong that it would fail with an error rather than just being ignored. I hate it when MS do this - backward compatibility is all very well but in some cases can lead you to think that an action has completed successfully rather than doing nothing! Am I the only one who'd rather start getting error messages so I knew I had to fix my code?
June 20, 2012 at 2:45 pm
I knew that repair_fast no longer worked, but guessed wrong that it would fail with an error rather than just being ignored. I hate it when MS do this - backward compatibility is all very well but in some cases can lead you to think that an action has completed successfully rather than doing nothing! Am I the only one who'd rather start getting error messages so I knew I had to fix my code?
You're certainly not the only one. A warning message might be OK instead of an error, but quietly doing nothing is irritating.
edit:spelling!
Tom
August 9, 2012 at 8:33 am
Good question!
October 6, 2012 at 7:40 am
hi,
Can anyone tell me How to check whether the database is in single user mode or multi user mode?
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Viewing 15 posts - 16 through 30 (of 30 total)
You must be logged in to reply to this topic. Login to reply