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 |
under2811
Constraint Violating Yak Guru
366 Posts |
Posted - 2007-08-27 : 07:28:41
|
Hi,I created clustered index on three columns of my DB table Index Name: IX_EmpCodeIndex Description: clustered, unique located on PRIMARYIndex Keys: EmpCode, CityID, EffectiveDateNow I want to insert record in table with all columns values same except EmpCode but I am getting error likeMsg 2601, Level 14, State 1, Line 1Cannot insert duplicate key row in object 'dbo.Employee' with unique index 'IX_EmpCode'.The statement has been terminated.My PK for table Employee is EmpCode.T.I.A |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-08-27 : 07:47:52
|
pk automaticaly puts a clustered index on the column.so your IX.. is a non clustered index._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-08-27 : 21:54:07
|
You created unique index on those columns, so can't insert dup value to those columns. |
 |
|
|
|
|