Hey,
I have a question regarding XML FOR PATH and SQL Server 2005. I have been using it successfully but I have run in to an issue I was hoping you could help with.
I have a couple of tables and I want to do this:
so, I KNOW this will cause an SQL error, I am just trying to show you the concept. Basically, I want to be able to change the attribute name from "StringValu e" to a field in my row called XmlFieldName and have that attribute set to the value that is contained in the StringValue column.
How can this be done within a select statement?
Thanks!
Brian
I have a question regarding XML FOR PATH and SQL Server 2005. I have been using it successfully but I have run in to an issue I was hoping you could help with.
I have a couple of tables and I want to do this:
Code:
select StringValue as '@' + XmlFieldName, from defaultaddressfielddefs daf inner join addressfields af on af.AddressFieldDefId = daf.AddressFieldDefId for xml path('Address'), type
How can this be done within a select statement?
Thanks!
Brian
Comment