0

This is the sample query:

INSERT INTO CUSTOMERS (ID, NAME, AGE, SALARY, ADDRESS)    
VALUES (1, 'Paul', 30, '1550.00', 'Ahmedabad')   

`if ID matches`  
then i want to UPDATE  the table
NAME='Paul', AGE=30,SALARY='1550.00', 
ADDRESS='Ahmedabad'

ID is the unique index column in the table.

I want to insert a new row if id does not match and if id matched then update the rest of the column.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
adams
  • 181
  • 3
  • 16
  • is there any way of using on conflict while creating table like ignore duplicate constraint or primary key constraint.. because i have multiple primary keys in the table and i am inserting the records dynamically using c# code – adams Jan 02 '19 at 06:40
  • Here you can read about and study the [proper syntax for `INSERT` in T-SQL](https://learn.microsoft.com/en-us/sql/t-sql/statements/insert-transact-sql?view=sql-server-2017) – marc_s Jan 02 '19 at 07:06

0 Answers0