------解决方案-------------------- 要用case才行
------解决方案-------------------- 程序块中只能使用CASE WHEN THEN,IF ELSE是包裹程序块的 CASE WHEN
SQL code
UPDATE Man SET TaskId = CASE WHEN TaskId IS NULL THEN @TaskId
ELSE TaskId END,
TaskIdd = CASE WHEN TaskId IS NULL THEN TaskIdd
ELSE CASE WHEN TaskIdd IS NULL THEN @TaskId
ELSE TaskIdd END END
WHERE ID = @ManId