问题
I'm trying to insert a row into a table which is quite big (400 million rows). The table has 3 columns (integer, varchar(128),varchar(255)), primary key
and clustered index
on columns (1,2) and nonclustered index
on columns (2,1) and nonclustered index on column 3. No foreign keys, no triggers.
When I do :
insert into mytable values (0,'test_name','test_val')
It executes successfully but it has no effect, nothing is inserted and I can re-execute it as many times as I want successfully whereas it should say "duplicate key".
What could be the issue?
Note : noexec is off and manual commit does not change anything.
回答1:
You probably have the ignore_dup_key
option on one of the indexes. Check the results of sp_help
procedure to see all the options that you are using for indexes.
回答2:
based on the documentation , if ignore_dup_key
was the culprit, you should get an error message when it cancels your insert .. you need to provide more details with your questions , like error log information , how do you insert the row .. etc.
Here's what the documentation says regarding the index option mentioned in the previous answer :
When you begin data entry, any attempt to insert a duplicate key is canceled with an error message.
来源:https://stackoverflow.com/questions/45150506/sybase-ase-15-5-a-successful-insert-which-has-no-effect