Thursday, February 11, 2010

a Sql Query to check and concatenate multiple col values into one column

update YourTable
set ColName=case when Col1 IS NOT NULL then (case when Col2 IS NOT NULL then Col1+'|'+Col2 else Col1 end) else NULL end

No comments:

Post a Comment