Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 #


Ïà¹ØÎĵµ£º

sql 2005 ´æ´¢¹ý³Ì·ÖÒ³ java ´úÂë

 create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',         
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ ......

SQLÓï¾ä

 --Óï ¾ä ¹¦ ÄÜ
--Êý¾Ý²Ù×÷
SELECT --´ÓÊý¾Ý¿â±íÖмìË÷Êý¾ÝÐкÍÁÐ
INSERT --ÏòÊý¾Ý¿â±íÌí¼ÓÐÂÊý¾ÝÐÐ
DELETE --´ÓÊý¾Ý¿â±íÖÐɾ³ýÊý¾ÝÐÐ
UPDATE --¸üÐÂÊý¾Ý¿â±íÖеÄÊý¾Ý
--Êý¾Ý¶¨Òå
CREATE TABLE --´´½¨Ò»¸öÊý¾Ý¿â±í
DROP TABLE --´ÓÊý¾Ý¿âÖÐɾ³ý±í
ALTER TABLE --ÐÞ¸ÄÊý¾Ý¿â±í½á¹¹
CREATE VIEW --´´½¨Ò»¸öÊÓÍ ......

¼òµ¥SQLÓï¾äС½á

ΪÁË´ó¼Ò¸üÈÝÒ×Àí½âÎÒ¾Ù³öµÄSQLÓï¾ä£¬±¾Îļٶ¨ÒѾ­½¨Á¢ÁËÒ»¸öѧÉú³É¼¨¹ÜÀíÊý¾Ý¿â£¬È«ÎľùÒÔѧÉú³É¼¨µÄ¹ÜÀíΪÀýÀ´ÃèÊö¡£
¡¡¡¡1.ÔÚ²éѯ½á¹ûÖÐÏÔʾÁÐÃû£º
¡¡¡¡a.ÓÃas¹Ø¼ü×Ö£ºselect name as 'ÐÕÃû' from students order by age
¡¡¡¡b.Ö±½Ó±íʾ£ºselect name 'ÐÕÃû' from students order by age
¡¡¡¡2.¾«È·²éÕÒ:
¡¡¡¡a.ÓÃ ......

SQL Start

 sqlÔÚ¶à·½ÃþË÷ºÍÅóÓѵİïÖúÏ£¬ÖÕÓÚ¿ÉÒÔÁ¬½Ó³É¹¦£¬Õâ¶ÔÎÒÀ´ËµÊǸöÀï³Ì±®À´µÄ£¬ÔÚ¹¤×÷µÄ¹ý³ÌÖÐÎÒ×ÜÊÇûÓлú»á¿ÉÒÔÅö´¥µ½SQL£¬µ±ÎÒ¹ÄÆðÓÂÆøÓÂÆøÏëѧϰµÄʱºòÎÒÁ¬ÔõôÓö¼²»»á£¬½øÀ´ÖÕÓÚÁ´½Ó³É¹¦£¬¿ªÐĵغÍÅóÓÑ·ÖÏíÎҵijɹû¡£
1.°²×°sql£¬Ñ§Ï°SQl£¬ÒòΪһ°ãÎÒÊÇÏëÒªÓÃÓÚVS2005ÏîÄ¿µÄ£¬ËùÒÔÒ»°ã×îºó¾ÍÏȰ²×°VSÈí¼þ£¬ÒÔ±ã ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ