Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I created view to add the all columns into one single column.
eg:
SQL
select cdata= naccount + cname from table


If I select the column it has data, but when I select the above like query inside view it show null.

please help me out of this

Thanks
Ramesh.m
Posted
v2

1 solution

There is a possibility that one of the columns you concatenated might be null causing the final concatenated result to be null. To avoid this use ISNULL[^] to give a default value.

Eg:
SQL
SELECT ISNULL(naccount,'') + ISNULL(cname,'') AS cdata FROM table
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900