Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL Server TEXTÀàÐÍ×Ö¶Î×Ö·û´®Ì滻ʾÀý´¦Àí½Å±¾

 /*--text×ֶεÄÌæ»»´¦Àí  
  --*/  
  --´´½¨Êý¾Ý²âÊÔ»·¾³  
--create   table   #tb(aa   text)
declare @s_str varchar(8000),@d_str varchar(8000),  --¶¨ÒåÌæ»»µÄ×Ö·û´® 
        @p varbinary(16),@postion int,@rplen int,@i_Start int, @i_End int
select identity(int,1,1) as [id],newsid into # from news
select @i_Start=min([id]),@i_End=max([id]) from #
while (@i_Start<=@i_End)
begin 
  --insert into #tb(aa) select content from # where [id]=@i_Start
  select   @s_str='\'   --ÒªÌæ»»µÄ×Ö·û´®  
  ,@d_str='!' --Ìæ»»³ÉµÄ×Ö·û´®     
  --×Ö·û´®Ìæ»»´¦Àí       
  select   @p=textptr(content),@rplen=len(@s_str),@postion=charindex(@s_str,content)-1 from news where newsid in (select top 1 newsid from # where [id]=@i_Start) 
  while   @postion>0  
  begin  
    updatetext   news.content   @p   @postion   @rplen   @d_str  
    select   @postion=charindex(@s_str,content)-1  from news where newsid in (select top 1 newsid from # where [id]=@i_Start)
  end 
  --truncate table #tb
 
  select @i_Start=@i_Start+1
end
 
--ɾ³ýÊý¾Ý²âÊÔ»·¾³  
--drop   table   #tb 
drop table #


Ïà¹ØÎĵµ£º

ASP³ÌÐòÓëSQL´æ´¢¹ý³ÌÏê½â

  ´æ´¢½ø³Ì¾ÍÊÇ×÷Ϊ¿ÉÖ´ÐжÔÏó´æ·ÅÔÚÊý¾Ý¿âÖеÄÒ»¸ö»ò¶à¸öSQLÃüÁî¡£
    ¶¨Òå×ÜÊǺܳéÏó¡£´æ´¢½ø³ÌÆäʵ¾ÍÊÇÄÜÍê³ÉÒ»¶¨²Ù×÷µÄÒ»×éSQLÓï¾ä£¬Ö»²»¹ýÕâ×éÓï¾äÊÇ·ÅÔÚÊý¾Ý¿âÖеÄ(ÕâÀïÎÒÃÇ̸ֻSQL SERVER)¡£Èç¹ûÎÒÃÇͨ¹ý´´½¨´æ´¢½ø³ÌÒÔ¼°ÔÚASPÖе÷Óô洢½ø³Ì£¬¾Í¿ÉÒÔ±ÜÃ⽫SQLÓï¾äͬASP´úÂë»ìÔÓÔÚÒ ......

SQLϰÌâ3

µÚ¶þÊ®Ì⣺
ÔõôÑù³éÈ¡ÖØ¸´¼Ç¼
񡜧
id name
--------
1 test1
2 test2
3 test3
4 test4
5 test5
6 test6
2 test2
3 test3
2 test2
6 test6
²é³öËùÓÐÓÐÖØ¸´¼Ç¼µÄÊý¾Ý£¬ÓÃÒ»¾äsql À´ÊµÏÖ
create table D(
id varchar (20),
name varchar (20)
)
insert into D values('1','test1')
insert into D val ......

sql´æ´¢¹ý³Ì

 ÔÚASP.NetÏîÄ¿ÖÐʹÓô洢¹ý³Ì,Ê×ÏÈ¿ÉÒÔÌá¸ßÊý¾Ý¿âµÄ°²È«ÐÔ£¬Æä´Î¿ÉÒÔÌá¸ßÔËÐÐSQL´úÂëÔËÐеÄËÙ¶È£¬ÔÚ´óÐÍÏîÄ¿ÖÐÒ»°ãÊDZز»¿ÉÉٵġ£Visual Studio.NetΪSQLµÄ´æ´¢¹ý³ÌÌṩÁËÇ¿´óµÄÖ§³Ö£¬Äú¼È¿ÉÒÔͨ¹ývisual studio.netÀ´Ð½¨´æ´¢¹ý³Ì£¬Ò²¿ÉÒÔÖ±½ÓÔÚSql ServerµÄ²éѯ·ÖÎöÆ÷ÖÐÔËÐУ¬»¹¿ÉÒÔͨ¹ýÆóÒµ¹ÜÀíÆ÷´´½¨£¬Ê¹ÓÃÆðÀ´Ò² ......

ÇÉÓö¯Ì¬ºêʵÏÖSQLÖд«µÝÖØ¸´²ÎÊý

ÈóǬ±¨±í¿ÉÒÔͨ¹ýSQL¼ìË÷ºÍ¸´ÔÓSQLÉú³ÉÊý¾Ý¼¯¡£µ±SQLÖÐÐèÒª´«Èë¶à¸ö²ÎÊýʱ£¬ÒªÔÚÉè¼ÆÆ÷ÖÐͨ¹ý ÅäÖÃ-²ÎÊý ¶¨ÒåÏàÓ¦µÄ²ÎÊý£¬È»ºóÔÙ°ÑSQLÖÐÐèÒª²ÎÊýµÄµØ·½Ìæ»»³É?£¬×îºó»¹ÒªÔÚSQL±à¼­Æ÷ÖÐÌí¼Ó¶ÔÓ¦?µÄ²ÎÊý¡£ÕâÑùµ±SQLÖÐÓжàÉÙ¸öÎʺţ¬ÎÒÃǾÍÐèÒªÌí¼Ó¶àÉÙ¸ö²ÎÊý¡£µ±SQLÖÐÓõ½µÄ²ÎÊý±È½ÏÉÙʱ£¬²Ù×÷ÆðÀ´»¹±È½Ï·½±ã¡£µ«µ±ÒµÎñ±È½Ï¸´ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ