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
  • 704,970
  • 168
  • 1,303
  • 1,425
adams
  • 161
  • 1
  • 14
  • 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://docs.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