Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 convert xml value

Author  Topic 

magmo
Aged Yak Warrior

558 Posts

Posted - 2010-04-08 : 14:54:57
Hi

I use this in a stored procedure to return a value from a xml field..

ISNULL(OrderRow.FormFields.query('data(/root/FirstName)'),'') As FirstName

But I need to convert it to varchar, how do I do that?

UPDATE: No need to answer, I got it working now

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-04-08 : 15:30:10
1) You can use CAST
2) You can use VALUE instead of QUERY method
3) Try use COALESCE instead of ISNULL



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -