retrieving data from xml column sql

kr4zy1

New Member
I have a table with an xml type column (column name is Before)here is a sample of the data\[code\]<row ID="47" By="Test User" Date="2006-07-26T00:00:00" Status="Closed" Closed_Date="2012-06-22T11:14:35.237" Closed_By="MrBig" />\[/code\]When I use this query to retrive the data, i get Nulls instead of the ID Numbers\[code\]SELECT before.value('ID[1]', 'int') ItemIdFROM dbo.AuditCROSS APPLY Before.nodes('.') N(C) \[/code\]Where am I going wrong?
 
Back
Top