October 30, 2008 at 2:08 pm
I have a query that concatenates values from columns which in some cases may be NULL. In SQL Server 2005 Express, this does not appear to be supported any more. When the query is executed, the rows that include NULL concatenated values are not returned. Is there a different way to make this work?
October 30, 2008 at 2:14 pm
Use isnull around each column: isnull(columnname,'')
October 30, 2008 at 2:22 pm
Did this ever work in any edition or version of SQL Server? I don't recall that it did...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
October 30, 2008 at 2:29 pm
If you can assume that a null is zero!!
COALESCE ([field name], 0) + COALESCE ([field name 2], 0)
is clean with the large assumption above.
October 30, 2008 at 2:38 pm
Oops, I missed the title. Now I see... 🙂
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
October 30, 2008 at 2:59 pm
Thanks. I didnt realize it was that simple. I was not familiar with IsNull().
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply