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)
 Parse XML from SQL column

Author  Topic 

ryanaud
Starting Member

4 Posts

Posted - 2007-10-30 : 12:45:20
I have in my database a column that has a long xml string. Is this possible to pull a single piece of information from this field.
Example:
<unittype>"complete"</unittype><color>"red"</color><width>"98"</width>

I am only wanting to pull the width in to my select statement.

Any thoughts.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-10-30 : 12:51:39
yes it is.
look in BOL about xml datatype and its nodes() and value() functions

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

ryanaud
Starting Member

4 Posts

Posted - 2007-10-30 : 14:19:34
What is BOL?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-10-30 : 15:45:23
BOL = Books Online = SQL Server help

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page
   

- Advertisement -