Hello
I'm pretty up on my MS T-SQL skills but this one is beating me! I have a table with a PK and the rest of the fields are part of a Unique Constraint. When I INSERT data into this table from the flat table (import is not normalized, SQL Job runs procedures to normalize) I have made sure I have used NOT IN ... and WHERE clauses to make sure it does not try and insert duplicate data. My code logic works on other tables except one. The INSERT statement thinks it is unqiue so it goes to insert but the table thinks it is NOT unique and violates the constraint. I have checked some columns and there is an extra 2 invisible characters in some columns. So, I though Ahh Chr(10) & Chr(13)! But doing a check there isn't! Dammit. Now I'm thinking Thanks MS SQL, one part of SQL is getting a different idea of the data than another part of SQL and the whole INSERT for this table fails due to this violation. Can anyone help?
Klae
You're only as good as your last answer!
I'm pretty up on my MS T-SQL skills but this one is beating me! I have a table with a PK and the rest of the fields are part of a Unique Constraint. When I INSERT data into this table from the flat table (import is not normalized, SQL Job runs procedures to normalize) I have made sure I have used NOT IN ... and WHERE clauses to make sure it does not try and insert duplicate data. My code logic works on other tables except one. The INSERT statement thinks it is unqiue so it goes to insert but the table thinks it is NOT unique and violates the constraint. I have checked some columns and there is an extra 2 invisible characters in some columns. So, I though Ahh Chr(10) & Chr(13)! But doing a check there isn't! Dammit. Now I'm thinking Thanks MS SQL, one part of SQL is getting a different idea of the data than another part of SQL and the whole INSERT for this table fails due to this violation. Can anyone help?
Klae
You're only as good as your last answer!