string sqlInsert = "Insert into account_details(
account_number,
account_type,
transfer_access_code,
account_balance,
customer_id)
SELECT
account_number,
account_type,
transfer_access_code,
account_balance,
customer_id
from customer_details";
This query just takes data from customer details(table1) and insert's it in other table2(account_details)
when this query is fired for first time it works fine
but when fired second time it show error Violation of PRIMARY KEY constraint 'PK_account_details'. Cannot insert duplicate key in object 'dbo.account_details'.
any idea to skip existing data in (account_details)table1 and inserting new data in next row