My requirement is to insert 3306 records from a FILE A in to table A and update these records in Table A from another FILE B which has 2642 on key match.
These two files have 2642 common records.I am inserting 3306 records in to SQL server Table A. Later I am updating Table A with 2642 records.When I update the table the result I am getting is 2605 records when I am supposed to get 2642.I thought may be there were no keys matching so I was not getting 2642 records. To make sure if there were keys match ,I joined these two flat files on keys using a lookup stage and wrote the data in to flat file and I got 2642 record.another way I approached was I inserted 3306 records in to Table A and 2642 in to Table B and updated Table A from Table B using a SQL query I still got 2605 records. but If I do an inner join for these two tables I on keys I am getting 2642 records.I am unable to understand where I am going wrong. Please help.
Problem while inserting and updating a same SQL server table
Moderators: chulett, rschirm, roy
Re: Problem while inserting and updating a same SQL server t
Check if you have multiple records with the same key in your files A or B.Hope wrote:My requirement is to insert 3306 records from a FILE A in to table A and update these records in Table A from another FILE B which has 2642 on key match.
These two files have 2642 common records.I am inserting 3306 records in to SQL server Table A. Later I am updating Table A with 2642 records.When I update the table the result I am getting is 2605 records when I am supposed to get 2642.I thought may be there were no keys matching so I was not getting 2642 records. To make sure if there were keys match ,I joined these two flat files on keys using a lookup stage and wrote the data in to flat file and I got 2642 record.another way I approached was I inserted 3306 records in to Table A and 2642 in to Table B and updated Table A from Table B using a SQL query I still got 2605 records. but If I do an inner join for these two tables I on keys I am getting 2642 records.I am unable to understand where I am going wrong. Please help.
Re: Problem while inserting and updating a same SQL server t
Check if you have multiple records with the same key in your files A or B.Hope wrote:My requirement is to insert 3306 records from a FILE A in to table A and update these records in Table A from another FILE B which has 2642 on key match.
These two files have 2642 common records.I am inserting 3306 records in to SQL server Table A. Later I am updating Table A with 2642 records.When I update the table the result I am getting is 2605 records when I am supposed to get 2642.I thought may be there were no keys matching so I was not getting 2642 records. To make sure if there were keys match ,I joined these two flat files on keys using a lookup stage and wrote the data in to flat file and I got 2642 record.another way I approached was I inserted 3306 records in to Table A and 2642 in to Table B and updated Table A from Table B using a SQL query I still got 2605 records. but If I do an inner join for these two tables I on keys I am getting 2642 records.I am unable to understand where I am going wrong. Please help.