Selecting null value from XML in SQL Server

前端 未结 8 1472
Happy的楠姐
Happy的楠姐 2021-02-19 20:23

I\'m trying to select from XML that has a null as one of the attributes. Instead of returning a null, it returns a 0. What am I doing wrong?
See code below to replicate:

8条回答
  •  孤街浪徒
    2021-02-19 21:00

    I've simply used NULLIF to turn empty strings into NULLs as needed.

    You can generate nil now using FOR XML, but I've never worked out how to parse it sorry...

提交回复
热议问题