Posted: Wed Nov 30, 2005 3:43 pm
Just remember that there are some limitations with using unique indexing. If you need to match case sensitive then unique indexing will not work as it is case insensitive. Password is the same as PaSSwoRd for unique indexing.
Plus if you are using stacked inserts like this one where col1 is a unique index...
"INSERT INTO tbl_name (col1,col2) VALUES(15,col1*2), (15,col1*2), (16,col1*2), (16,col1*8)"
Then the second set of values would fail and the third and fourth would not be inserted. You could use the IGNORE command...
"INSERT IGNORE INTO tbl_name (col1,col2) VALUES(15,col1*2), (15,col1*2), (16,col1*2), (16,col1*8)"
Then the second and forth value sets would be ignored and no errors would be issued. You can't check to see what inserts failed in this case.
Plus if you are using stacked inserts like this one where col1 is a unique index...
"INSERT INTO tbl_name (col1,col2) VALUES(15,col1*2), (15,col1*2), (16,col1*2), (16,col1*8)"
Then the second set of values would fail and the third and fourth would not be inserted. You could use the IGNORE command...
"INSERT IGNORE INTO tbl_name (col1,col2) VALUES(15,col1*2), (15,col1*2), (16,col1*2), (16,col1*8)"
Then the second and forth value sets would be ignored and no errors would be issued. You can't check to see what inserts failed in this case.