sql²éѯ¸üеÄЧÂÊÎÊÌâ - MS-SQL Server / »ù´¡Àà
±íciku (ÕâÀïÓкº×Ö´ÊÎå°Ù¶àÍòÌõ£¬ºº×ÖÊý2-10²»µÈ)
ÏëʵÏÖ¸üÐÂ
SQL code:
update ciku set hz_pinyin = dbo.f_gettotalpy(hz_hanzi)
----º¯Êý £¬ÆäÖбízdÊǺº×ֿ⣬ÓÐÿ¸öµ¥¸öºº×ÖÓë ¶ÔÓ¦µÄÆ´Òô ²»¿¼ÂǶàÒô×Ö-----
SQL code:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER function f_gettotalpy(@str varchar(100))
returns varchar(800)
as
begin
declare @re varchar(800)
declare @i int,@ilen int,@splitchr varchar(1)
select @splitchr='' --Á½¸öÆ´ÒôÖ®¼äµÄ·Ö¸ô·û(Ä¿µÄÊÇΪÁËͨÓÃÐÔ¿¼ÂÇ)
,@i=1,@ilen=len(@str)
select @re=pinyin from zd where hanzi=substring(@str,@i,1)
while @i<@ilen
begin
set @i=@i+1
select top 1 @re=@re+@splitchr+pinyin
from zd2 where hanzi=substring(@str,@i,1)
end
return(@re)
end
ÎÒÓà update ciku set hz_pinyin = dbo.f_gettotalpy(hz_hanzi) where hz_len=2 and hz_pinyin is null and hz_id<1000000 ¸üÐÂ100ÍòÌõÊý¾Ý20·ÖÖÓÁË»¹Ã»ºÃ¡£ Õ⻹ÊÇÖ»¸üÐÂ2¸öºº×Ö³¤¶ÈµÄ¡£
ÎÊÏÂÈçºÎÌá¸ßÏÂЧÂÊ¡£
¿´µÄ²»ÊǺÜÃ÷°×£¬°ï¶¥¡£
2000»¹ÊÇ2005£¿
SQL 2000ÖУ¬Èç¹ûSQL2005Óк÷½·¨Ò²¿ÉÒÔ»»³ÉSQL 2005
ÄãÕ
Ïà¹ØÎÊ´ð£º
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
tab1 ×Ö¶Î:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 ×Ö¶Î:goodsid,goodskind£¨ÉÌÆ·ÀàÐÍ£©
tab3 ×Ö¶Î:goodskind£¨ÉÌÆ·ÀàÐÍ£©,kindname
½á¹û£º
µÃµ½ÉÌÆ·ÀàÐÍÔÚÒ»¶Îʱ¼ä ......
1¡£ÔõÑùʹxp_cmdshellÄÜÍêÕûÊä³ö³¬¹ý255¸ö×Ö·ûµÄ×Ö·û´®¡£
2¡£select ʱ£¬¼ìË÷ËÙ¶ÈÊÇÓëfromºóµÄ TABLE˳ÐòÓйأ¬»¹ÊÇÓëwhereÌõ¼þµÄ˳ÐòÓйØ(TABLEÊý¾Ý¶àÉÙ )
ÔÚϵͳÊôÐÔÉ趨ÀïÓиöÑ¡Ïî,¿ÉÒÔÐ޸ĵ¥×Ö¶ÎÊä³ö×ÖÊýÏÞÖÆ. ......
ÐèÇóÈçÏ£º
ѧԺ academy£¨aid,aname£©
°à¼¶ class£¨cid,cname,aid£©
ѧÉú stu(sid,sname,aid,cid)
סËÞÇø region(rid,rname)
ËÞÉáÂ¥ build(bid,rid,bnote) bnoteÊÇ¡®ÄС¯/¡®Å®¡¯
ËÞÉá dorm(did,rid,bid£¬bedn ......