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 (100)
- Ruby on Rails (5)
- SmartPhone (4)
- SOA (2)
- Sql (43)
- Ubuntu (11)
- Visual Basic (21)
- Web (1)
My Google Reader- These Pictures Will Melt Your Mind
- Como agir com sustentabilidade no trabalho?
- Seu cliente merece recomendações, não apenas opções
- Os 10 Países mais e menos perigosos do mundo 2009
- Os incomodados são os que mudam
- Um empresa inteira “ágil”?
- Sedentarismo e TI
- Palestras do Ano de 2009
- Brazilian Ruby on Rails Portfolio
- Três tendências para 2010 no mundo de desenvolvimento
My Wallpapersmy twitter
- RT @josesimaoband: "Eu fiquei com medo de o Schwarzenegger atirar no Serra em Copenhague, achando que era um zumbi" (via @fribeiro1) 8 hours ago
- Só agora fui enteder pq a operadora Oi se chama Oi, é a única coisa que dá para falar antes da ligação cair. (via @iTrigo) 8 hours ago
- hahahah RT: @fribeiro1: Eu prefiro ter um filho viado do que um filho NullPointerException. 19 hours ago
- #Progress, nem parece banco! hahahaha 3 days ago
- RT: @jmonteiro: Top 5 Interview Questions: http://www.youtube.com/watch?v=S6frktRio5g #fun 1 week ago
- RT: @leozera: no msn de um amigo: "nunca discuta com um idiota, ele te rebaixa ao nível dele e te vence pela experiência" #frasedodia 3 weeks ago
- @djbressler Which company? 3 weeks ago
- Diluvio... #sp 3 weeks ago
- hahaha RT: @fribeiro1: Gerente: Fez? Estagiário: Com certeza. Gerente: Tá bom. Estagiário: ... mas vou confirmar. 3 weeks ago
- When you are working in a holiday, you see unbelievable things. lol 3 weeks ago
-
Top Posts
category cloud
Visitors

No Responses Yet to “Errors in SQL Server”