Selecting null value from XML in SQL Server
问题 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: declare @a xml select @a = '<TestSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instace"> <Element> <Property1>1</Property1> <Property2>1</Property2> </Element> <Element> <Property1 xsi:nil="true" /> <Property2>2</Property2> </Element> <Element> <Property1>3</Property1> <Property2>3</Property2> </Element> </TestSet>' select