How to query for Xml values and attributes from table in SQL Server?

Actually you’re close to your goal, you just need to use nodes() method to split your rows and then get values: select s.SqmId, m.c.value(‘@id’, ‘varchar(max)’) as id, m.c.value(‘@type’, ‘varchar(max)’) as type, m.c.value(‘@unit’, ‘varchar(max)’) as unit, m.c.value(‘@sum’, ‘varchar(max)’) as [sum], m.c.value(‘@count’, ‘varchar(max)’) as [count], m.c.value(‘@minValue’, ‘varchar(max)’) as minValue, m.c.value(‘@maxValue’, ‘varchar(max)’) as maxValue, m.c.value(‘.’, ‘nvarchar(max)’) as Value, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)