Skip to content

Tag: xml

SQL – Remove all HTML tags in a string

In my dataset, I have a field which stores text marked up with HTML. The general format is as follows: <html><head></head><body><p>My text.</p></body></html> I could attempt to solve the problem by doing the following: However, this is not a strict rule as some …

XML Schema totalDigits/fractionDigits vs. SQL precision/scale

I’d like to find out the correspondence between XML Schema totalDigits/fractionDigits and SQL numeric precision/scale. 1) Assume we have the following simple type: How would I represent it in SQL? Let’s assume HSQL dialect (it does not matter much). I’m interested in the most restrictive SQL…

How to count occurrences of a node in SQL XML?

I am trying to do a count on the number of occurrences of the “Colors” node but have been so far unsuccessful. Below is what I have tried so far. If I have the following logic: I get the following error: Msg 2389, Level 16, State 1, Line 50 XQuery [value()]: ‘value()’ requires a single…