<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Tahoma;}
</STYLE>


<STYLE>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Tahoma;}
</STYLE>
Hi all,<BR>&nbsp;<BR>I am&nbsp;using SQL Server 2005. I have a table with xml column in which I have loaded an XML file. I want to write an xquery which finds the number of occurrences of a string in the document in some defined tags.<BR>&nbsp;<BR>The structure of the document is as follows:<BR>&nbsp;<BR>&lt;subject&gt;<BR>&lt;displaySubject = "Day"&gt;<BR>&lt;alt&gt; &lt;/alt&gt;<BR>&lt;alt&gt; &lt;/alt&gt;<BR>&lt;alt&gt; &lt;/alt&gt;<BR>&lt;alt&gt; &lt;/alt&gt;<BR>&lt;/displaySubject&gt;<BR>&lt;/subject&gt;<BR>&lt;subject&gt;<BR>&lt;displaySubject&gt;<BR>&lt;alt&gt; &lt;/alt&gt;<BR>&lt;alt&gt; &lt;/alt&gt;<BR>&lt;alt&gt; &lt;/alt&gt;<BR>&lt;alt&gt; &lt;/alt&gt;<BR>&lt;/displaySubject&gt;<BR>&lt;/subject&gt;<BR>&nbsp;<BR>&nbsp;<BR>So, I want to find how many time the string "Day" occurs whether in displaySubject or alt anywhere in the document.<BR>Also, the "Day" string is not known. I want to find all the strings that occur more than 50 times in the document.<BR>&nbsp;<BR>I hope I am clear.<BR>I would appreciate any help from you.<BR>&nbsp;<BR>Thanks<BR>Mudita<BR><BR>
&nbsp;<BR>
&nbsp;<BR><br /><hr />Instantly invite friends from Facebook and other social networks to join you on Windows Live™ Messenger. <a href='https://www.invite2messenger.net/im/?source=TXT_EML_WLH_InviteFriends' target='_new'>Invite friends now!</a></body>
</html>