My table is VARIETY where:
- Var_id INT PK NOTNULL AI
- Var_Code VARCHAR UNIQUE NOTNULL
- Var_name VARCHAR
- Var_note TEXT
If I import excel file with Var_id field empty then all records added to the table as new records. If my excel file has Var_id field filled then the specific records are updated. But I want this var_id field on my excel file should be left empty always but Var_Code field should be filled (NOT NULL). When I import this file, I want the application should check Var_code field first and do either new insert (in case mismatch) or update old record (in case duplicate). Could anyone please give me idea how can I accomplish this? Thanks.