| 
                
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. 
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | saigeethaStarting Member
 
 
                                        1 Post | 
                                            
                                            |  Posted - 2010-08-06 : 15:23:23 
 |  
                                            | Msg 2627, Level 14, State 1, Line 2Violation of PRIMARY KEY constraint 'PK__emp__7C8480AE'. Cannot insert duplicate key in object 'dbo.emp'.The statement has been terminated.Hi i have created a trigger for emp table.Trigger created successfully ,but while i am inserting the values into the table i got the above error. Emp table structure is:create table emp(empno int primary key, empname varchar(15),job varchar(15),sal money,hiredate datetime ,deptno int)Trigger query:To verify whether user inserting salary more than 6000 or not.Inserted value in to the table:insert emp values(125,'Ravi','clerk',8000,'6/7/2007',10) .Could anyone help on this issue.Thanks,saigeetha |  |  
                                    | tkizerAlmighty SQL Goddess
 
 
                                    38200 Posts |  |  
                                |  |  |  |  |  |