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

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -