I want to insert some data in my column only if my query parameters are not already added.
For example, if my row contains :
a=4&b=7&c=9
and now, when update happens with : b=7&c=9, then i should not append it.
o/p:a=4&b=7&c=9
But if update happens with d=9&e=9 then it should append it.
o/p : a=4&b=7&c=9&d=9&e=9
My normal Update query is :
@AdditionalParams = 'b=7&c=9'
SELECT @id = mid FROM Table2 WHERE sid = @SId
AND cid = @CId;
UPDATE Table1
SET additional_params = CONCAT (
additional_params
,iif(additional_params IS NULL, NULL, '&')
,@AdditionalParams
)
WHERE mid = @id
How can i use here the NOT EXIST Clasue.
But with not exist clause it checks whole row, I just want to check if parameters exist, then dont insert it.