<content><docDeck>All you need to know before hitting the send button.</docDeck>
<docBody>
&lt;?XML:NAMESPACE PREFIX = MSTR /&gt;&lt;FXNT color=black face="Times New Roman, Times, serif" size=3&gt;&lt;P&gt;
As if a 135% return in 1999 weren't impressive enough, here's yet another technology-fund fact to make your head spin. The last year tech funds lost money, President Reagan was wrapping up his first term in the White House, 
&amp;quot;Amadeus&amp;quot; won the Oscar for best picture, and Microsoft &lt;MSTR:SECURITY&gt;MSFT&lt;/MSTR:SECURITY&gt; was still privately held. That's right: The average technology fund has finished every year since 1985 in the black. No other stock-fund category has done that. &lt;P&gt;Whether  &lt;B&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;
</docBody>
<authorHoldings></authorHoldings></content>以上为text数据列中text数据,中间删除了很多。
想要得到的结果是:
As if a 135% return in 1999 weren't impressive enough, here's yet another technology-fund fact to make your head spin. The last year tech funds lost money, President Reagan was wrapping up his first term in the White House, 
&amp;quot;Amadeus&amp;quot; won the Oscar for best picture, and Microsoft &lt;MSTR:SECURITY&gt;MSFT&lt;/MSTR:SECURITY&gt; was still privately held.取200个字符吧

解决方案 »

  1.   

    先要把标记使用循环处理掉,然后在left(col,200)
      

  2.   


    在这个基表上建立了一个分页存储过程,并返回。
    如果把这个text列的全部内容否返回给程序的话,想必是非常耗资源了。
      

  3.   


    if object_id('#a') is not null
    drop table #a
    GODECLARE   @text  xml 
    SET   @text   ='<content> <docDeck>All you need to know before hitting the send button. </docDeck> 
    <docBody> 
    &lt;?XML:NAMESPACE PREFIX = MSTR /&gt;&lt;FXNT color=black face="Times New Roman, Times, serif" size=3&gt;&lt;P&gt; 
    As if a 135% return in 1999 weren''t impressive enough, here''s yet another technology-fund fact to make your head spin. The last year tech funds lost money, President Reagan was wrapping up his first term in the White House, 
    &amp;quot;Amadeus&amp;quot; won the Oscar for best picture, and Microsoft &lt;MSTR:SECURITY&gt;MSFT&lt;/MSTR:SECURITY&gt; was still privately held. That''s right: The average technology fund has finished every year since 1985 in the black. No other stock-fund category has done that. &lt;P&gt;Whether  &lt;B&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt; 
    </docBody> 
    <authorHoldings> </authorHoldings> </content> 'Select 
    T.i.value ('.','varchar(300)')  ItemName
    into #a
    From @text.nodes('content/docBody') as T(i);
    GO
    select ItemName=cast(replace(ItemName,'<?XML:NAMESPACE PREFIX = MSTR /><FXNT color=black face="Times New Roman, Times, serif" size=3><P>','')
    as varchar(200))
     from #a
    --result:
    ItemName
        As if a 135% return in 1999 weren't impressive enough, here's yet another technology-fund fact to make your head spin. The last year tech funds lost money, President Reagan was wrapping up his fir--仅供娱乐
      

  4.   

    是text数据类型,系统是SQL 2000.