I have to update a lot of columns with one query, but the fields which should be updated vary from parameters. i do not want update always all columns resp. fill them with the value existing because of some triggers. Is there a way to achieve, that like in this example instead of NULL for 'ldf' 1 and 3 the field is not touched:
DECLARE @t1 TABLE (lfd INT, txt NVARCHAR(50));
INSERT INTO @t1 ([lfd], [txt]) VALUES (1, 'abc');
INSERT INTO @t1 ([lfd], [txt]) VALUES (2, 'def');
INSERT INTO @t1 ([lfd], [txt]) VALUES (3, 'ghi');
SELECT * FROM @t1
UPDATE @t1 SET txt = (CASE WHEN lfd = 2 THEN 'xxx' END)
SELECT * FROM @t1
any help appreciated. thanks in advance