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 #
Ïà¹ØÎĵµ£º
1.´ò¿ªSQL Server Management Studio ExpressÒÔ“WindowsÉí·ÝÈÏÖ¤”µÄ·½Ê½µÇ¼¡£Èçͼ1£º
ͼ1£º
2.ÔÚSQL Server Management Studio ExpressÖеē¶ÔÏó×ÊÔ´¹ÜÀíÆ÷”--“Êý¾Ý¿â”ÉÏÓÒ¼ü--“¸½¼Ó”¡£Èçͼ2£º
ͼ2£º
3.ÔÚµ¯³öÀ´µÄ“¸½¼ÓÊý¾Ý¿â”´°¿ÚÖе¥» ......
²Ù×÷·ûÓÅ»¯
IN ²Ù×÷·û
ÓÃINд³öÀ´µÄSQLµÄÓŵãÊDZȽÏÈÝÒ×д¼°ÇåÎúÒ×¶®£¬Õâ±È½ÏÊʺÏÏÖ´úÈí¼þ¿ª·¢µÄ·ç¸ñ¡£
µ«ÊÇÓÃINµÄSQLÐÔÄÜ×ÜÊDZȽϵ͵쬴ÓORACLEÖ´ÐеIJ½ÖèÀ´·ÖÎöÓÃINµÄSQLÓë²»ÓÃINµÄSQLÓÐÒÔÏÂÇø±ð£º
ORACLEÊÔͼ½«Æäת»»³É¶à¸ö±íµÄÁ¬½Ó£¬Èç¹ûת»»²»³É¹¦ÔòÏÈÖ´ÐÐINÀïÃæµÄ×Ó²éѯ£¬ÔÙ²éѯÍâ²ãµÄ±í¼Ç¼£¬Èç¹ûת»»³ ......
.NETÖÐC#µÄbyte¹Ø¼ü×ÖÓ³Éä.NETµÄByte½á¹¹£º±íʾһ¸ö 8 λÎÞ·ûºÅÕûÊý¡£Byte ÖµÀàÐͱíʾֵ½éÓÚ 0 ºÍ 255 Ö®¼äµÄÎÞ·ûºÅÕûÊý¡£
.NETÖÐC#µÄshort¹Ø¼ü×ÖÓ³Éä.NETÖеÄInt16£ºÓзûºÅ 16 λÕûÊý£¬-32,768 µ½ 32,767¡£
SQL SERVERÖеÄtinyint:´Ó 0 µ½ 255 µÄÕûÐÍÊý¾Ý¡£´æ´¢´óСΪ 1 ×Ö½Ú¡£
sbyte£º´æ´¢8λ´ø·ûºÅÕûÊý¡£sbyt ......
ÈóǬ±¨±í¿ÉÒÔͨ¹ýSQL¼ìË÷ºÍ¸´ÔÓSQLÉú³ÉÊý¾Ý¼¯¡£µ±SQLÖÐÐèÒª´«Èë¶à¸ö²ÎÊýʱ£¬ÒªÔÚÉè¼ÆÆ÷ÖÐͨ¹ý ÅäÖÃ-²ÎÊý ¶¨ÒåÏàÓ¦µÄ²ÎÊý£¬È»ºóÔÙ°ÑSQLÖÐÐèÒª²ÎÊýµÄµØ·½Ìæ»»³É?£¬×îºó»¹ÒªÔÚSQL±à¼Æ÷ÖÐÌí¼Ó¶ÔÓ¦?µÄ²ÎÊý¡£ÕâÑùµ±SQLÖÐÓжàÉÙ¸öÎʺţ¬ÎÒÃǾÍÐèÒªÌí¼Ó¶àÉÙ¸ö²ÎÊý¡£µ±SQLÖÐÓõ½µÄ²ÎÊý±È½ÏÉÙʱ£¬²Ù×÷ÆðÀ´»¹±È½Ï·½±ã¡£µ«µ±ÒµÎñ±È½Ï¸´ ......