check if record exists then update else insert in sql server