SQL Server : append string not working if col is empty -
i need programatically append string col1
. below code works in case col1
not empty. if it's empty after running code remains empty. why?
update table set col1 = col1 + ';somestring' col2 = rowid
that's because operation null
results in null
. need use isnull()
"transform" null
values empty strings:
update table set col1 = isnull(col1, '') + ';somestring' col2 = rowid
Comments
Post a Comment