Errors in SQL Server
If you had worked with Sql certainly you saw the error message below.
Msg 2627, Level 14, State 1, Line 1
Violation of PRIMARY KEY constraint ‘PK_MYTABLE’. Cannot insert duplicate key in object ‘MYTABLE’.
The statement has been terminated.
The message has five components:
Msg
Each error message has a number starting with 0.
Message numbers from 50001 and up are reserved for user-defined use. Lower numbers are system defined.
Level
This defines the severity of the error generated.
It is a number between 0 and 25
0-10 defines some informational message or a warning
11-16 are the errors in the programming
17 and above defines problems with the lack of server resources or hardware problems
Above 20 will terminate the connection
State
This is a number between 0 and 127.
There is not much information disclosed about this by Microsoft… so I will not discuss this in this post.
Line
This specifies the line number in the procedure/function/trigger/batch where the error has actually occurred.
Msg Desc
Check it out the table sysmessages
select * from master..sysmessages
That’s all folks…
Filed under: Sql | Leave a Comment
Tags: error, example, level, line, msg, mssql, Server, Sql, state, sysmessages, T-Sql
categories
- English (9)
- iPod (2)
- Java (22)
- Mobile (1)
- News (1)
- Others (26)
- Progress (96)
- Ruby on Rails (5)
- SmartPhone (4)
- SOA (2)
- Sql (43)
- Ubuntu (10)
- Visual Basic (21)
- Web (1)
My Google Reader
My Wallpapersmy twitter
- #SOA Manifesto... http://tinyurl.com/ygp9cen 2 days ago
- Eh #palmeiras eim... soh desgosto! 3 days ago
- #Ubuntu 9.10.... let's see if it works. 3 days ago
- Does anyone using karmic Koala? #ubuntu 5 days ago
- Today I saw a query with 8 sub selects... wtf? 6 days ago
- @herbertduck ah se seu sogro tivesse twitter... 1 week ago
- I used to play #aoe2... yesterday I played #aoe3. I still prefer the 2... best game ever! 1 week ago
- @suntechdays Sun Tech Days 2009-2010... http://tinyurl.com/yl2d5fv 1 week ago
- #Ubuntu ISO images for #dell... http://tinyurl.com/yglaarf 2 weeks ago
- RT: @talesmorais: E eu que sempre achei cama elástica sem graça... http://bit.ly/17QLRO 2 weeks ago
-
Top Posts
category cloud
Visitors

No Responses Yet to “Errors in SQL Server”