August 2014
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
[post_grid id="69"]

Violation of PRIMARY KEY constraint

Violation of PRIMARY KEY constraint ‘PK_TABLA’. Cannot insert duplicate key in object ‘dbo.TABLA’.
The statement has been terminated.

La solución es:

DBCC CHECKTABLE (‘TABLA’)

GO
DBCC DBREINDEX (‘TABLA’)

 

o si ni da ningun resultado

ante un mensaje que puede salir

Msg 2627, Level 14, State 1, Line 1
Violation of PRIMARY KEY constraint ‘PK_tabla’. Cannot insert duplicate key in object ‘dbo.tabla’.
The statement has been terminated.

prueba con

DBCC CHECKIDENT (‘tabla’)
DBCC CHECKIDENT (‘tabla’, RESEED).

Leave a Reply

Your email address will not be published.