March 1, 2011 at 1:52 pm
I am doing an exam review package and think that the following question and answer is incorrect. Before I bring it up to the exam company, can I get some iput here...maybe I'm completely off base.
Q: You manage an instance of SQL Server 2008. A custom application includes stored procedures that raise errors of severity 10 through 16. You need to view the errors logged by the application.
What should you do:
A. Query sys.messages
B. Execute @@error
C. View the Application Log in the Event Viewer
D. View the System log in Event Viewer.
The test key says that A is the correct answer. However my understanding is the sys.messages is a table of all error messages, both system and user defined (via sp_addmessage) but it is not a log of errors that have occurred in an application. I don't see a fully correct answer in the list - if the application stored procedures used RAISERROR WITH LOG or if the application added custom errors to sys.messages with the @with_log parameter set to TRUE then I would say that C is the correct answer. But otherwise none of these really answer the question.
Am I completely off base on this? If not, I guess I'll try to contact the training company and see what they say.
Thanks,
MWise
March 1, 2011 at 2:06 pm
I'd never expect to see severity 10 (or below) errors in a log, since those are "info messages", and don't even switch control from Try to Catch when raised. So yeah, the question is at least flawed/unclear.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
March 2, 2011 at 12:53 pm
You should upgrade to Transcender or another professional practice exam company because they will have direct references to BOL and other sources for each of their answers. Answers without explanations and references are worthless. Your time and study efforts are worth the upgrade.
March 2, 2011 at 1:43 pm
The company's test review comes with references in the test key and explanations. I just think they are wrong on this one. Transcender does not actually offer courses on 70-432 while the company I'm using does along with a practice test and chapter reviews.
This is what the key says:
You should query sys.messages. All errors raised by stored procedures are logged in sys.messages, regardless of the error severity.
You should not execute @@ERROR. You can use @@ERROR to return the error number for the last Transact-SQL statement executed in a session. It cannot be used to retrieve historical information.
You should not view the System log in Event Viewer. Errors raised by SQL Server stored procedures are not logged to the System log. You should not view the Application log in Event Viewer. Only errors that have a severity level between 19 and 25 are logged to the Application log.
http://technet.microsoft.com/en-us/library/ms165761.aspx
March 2, 2011 at 2:39 pm
Inform them that they are 100% completely wrong about that.
Proof:
CREATE PROC ErrorTest
AS
RAISERROR ('Test message', 10, 1);
GO
EXEC ErrorTest;
GO
SELECT *
FROM sys.messages
WHERE message_id >= 50000
OR text = 'Test message';
If that proc "logged" an error in sys.messages, it would come up from that final query. It most certainly does not.
Per MSDN:
sys.messages (Transact-SQL)
Contains a row for each message_id or language_id of the error messages in the system, for both system-defined and user-defined messages. For more information, see sp_addmessage (Transact-SQL).
It's not a log. It's a lookup "table" for error message codes.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
March 2, 2011 at 7:57 pm
That's what I thought, but I want to make sure I just wasn't being completely obtuse. After doing my regular day job, finishing up the training session with 29 slides on Replication, and then diving into the practice exam the mind does get fuzzy! I appreciate the second (and third) pair of eyes on this.
Thanks,
MWise
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply