Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 What are Severity Levels

Author  Topic 

LMS56K
Starting Member

6 Posts

Posted - 2002-02-19 : 14:03:15
Hello All,

I am creating a database management system using database "Triggers", and I have come across something called "Severity Levels".

Please can anyone describe what "Severity Levels" are, including the following:

-What Severity Levels are
-Description of the differrent levels related with "Triggers"
-Why Severity Levels

Cheers Lee

How much do you know about yourself if you've never been in a fight?

chadmat
The Chadinator

1974 Posts

Posted - 2002-02-19 : 14:18:18
From BOL:

Error Message Severity Levels
The severity level of an error message provides an indication of the type of problem that Microsoft® SQL Server™ 2000 has encountered.

Severity level 10 messages are informational and indicate problems caused by mistakes in the information you have entered. Severity levels from 11 through 16 are generated by the user, and can be corrected by the user.

Severity levels from 17 through 25 indicate software or hardware errors. You should inform the system administrator whenever problems that generate errors with severity levels 17 and higher occur. The system administrator must resolve these errors and track their frequency. When a level 17, 18, or 19 error occurs, you can continue working, although you might not be able to execute a particular statement.

The system administrator should monitor all problems that generate severity levels from 17 through 25 and print the error log that contains information to backtrack from the error.

If the problem affects an entire database, you can use DBCC CHECKDB (database ) to determine the extent of the damage. DBCC may identify some objects that must be removed and will optionally repair the damage. If damage is extensive, the database might have to be restored.

When specifying user-defined error messages with RAISERROR, use error message numbers greater than 50,000 and severity levels from 0 through 18. Only system administrators can issue RAISERROR with a severity level from 19 through 25.

Severity Levels 0 through 19
Error messages with a severity level of 10 are informational. Error messages with severity levels from 11 through 16 are generated by the user and can be corrected by the user. Severity levels from 17 and 18 are generated by resource or system errors; the user's session is not interrupted.

Using sp_addmessage, user-defined messages with severities from 1 through 25 can be added to sysmessages. Only the system administrator can add messages with severities from 19 through 25.

Error messages with severity levels 17 and higher should be reported to the system administrator.

Severity Level 10: Status Information

This is an informational message that indicates a problem caused by mistakes in the information the user has entered. Severity level 0 is not visible in SQL Server.

Severity Levels 11 through 16

These messages indicate errors that can be corrected by the user.

Severity Level 17: Insufficient Resources

These messages indicate that the statement caused SQL Server to run out of resources (such as locks or disk space for the database) or to exceed some limit set by the system administrator.

Severity Level 18: Nonfatal Internal Error Detected

These messages indicate that there is some type of internal software problem, but the statement finishes, and the connection to SQL Server is maintained. For example, a severity level 18 message occurs when the SQL Server query processor detects an internal error during query optimization. The system administrator should be informed every time a severity level 18 message occurs.

Severity Level 19: SQL Server Error in Resource

These messages indicate that some nonconfigurable internal limit has been exceeded and the current batch process is terminated. Severity level 19 errors occur rarely; however, they must be corrected by the system administrator or your primary support provider. The administrator should be informed every time a severity level 19 message occurs.

Severity Levels 20 through 25
Severity levels from 20 through 25 indicate system problems. These are fatal errors, which means that the process (the program code that accomplishes the task specified in your statement) is no longer running. The process freezes before it stops, records information about what occurred, and then terminates. The client connection to SQL Server closes, and depending on the problem, the client might not be able to reconnect.

Error messages with a severity level of 19 or higher stop the current batch. Errors messages with a severity level of 20 or higher are considered fatal errors and terminate the client connection. Errors messages in this range may affect all of the processes in the database, and may indicate that a database or object is damaged. Error messages with a severity level from 19 through 25 are written to the error log.

Severity Level 20: SQL Server Fatal Error in Current Process

These messages indicate that a statement has encountered a problem. Because the problem has affected only the current process, it is unlikely that the database itself has been damaged.

Severity Level 21: SQL Server Fatal Error in Database (dbid) Processes

These messages indicate that you have encountered a problem that affects all processes in the current database; however, it is unlikely that the database itself has been damaged.

Severity Level 22: SQL Server Fatal Error Table Integrity Suspect

These messages indicate that the table or index specified in the message has been damaged by a software or hardware problem.

Severity level 22 errors occur rarely; however, if you should encounter one, run DBCC CHECKDB to determine if other objects in the database are also damaged. It is possible that the problem is in the cache only and not on the disk itself. If so, restarting SQL Server corrects the problem. To continue working, you must reconnect to SQL Server. Otherwise, use DBCC to repair the problem. In some cases, it may be necessary to restore the database.

If restarting does not help, the problem is on the disk. Sometimes destroying the object specified in the error message can solve the problem. For example, if the message tells you that SQL Server has found a row with a length of 0 in a nonclustered index, delete the index and rebuild it.

Severity Level 23: SQL Server Fatal Error: Database Integrity Suspect

These messages indicate that the integrity of the entire database is in question because of a hardware or software problem.

Severity level 23 errors occur rarely; however, if you should encounter one, run DBCC CHECKDB to determine the extent of the damage. It is possible that the problem is in the cache only and not on the disk itself. If so, restarting SQL Server corrects the problem. To continue working, you must reconnect to SQL Server. Otherwise, use DBCC to repair the problem. In some cases, it may be necessary to restore the database.

Severity Level 24: Hardware Error

These messages indicate some type of media failure. The system administrator might have to reload the database. It might also be necessary to call your hardware vendor.

-Chad

Go to Top of Page

LMS56K
Starting Member

6 Posts

Posted - 2002-02-19 : 15:19:29
OK!

I have created the following trigger.

----
CREATE TRIGGER [RaiseError] ON [dbo].[PotentialFaults]
FOR INSERT
AS

if @@error = 0 ---Successful
RAISERROR 50001 "A Potential Fault has just been logged by "
----

What Severity Level does the "RAISERROR 50001" fall into?

Cheers Lee




How much do you know about yourself if you've never been in a fight?
Go to Top of Page

chadmat
The Chadinator

1974 Posts

Posted - 2002-02-19 : 15:25:23
That is up to you. What is the severity of the fault that occurs? If the insert is just being rolled back, it seems like more of an informative message. It certainly doesn't look to be 19 or higher, but you should determine the severity on your own.

-Chad

Go to Top of Page
   

- Advertisement -