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

µ÷ÓÃSQLº¯ÊýÀ´ÊµÏÖºº×ÖÄ£ºý²éѯ

ÔÚsqlÖд´½¨Óû§×Ô¶¨Ò寴Òôº¯Êý£º
create function f_GetPy(@Str nvarchar(400))
returns nvarchar(4000)
as
begin
declare @strlen int,@re nvarchar(4000)
declare @t table(chr nchar(1) collate Chinese_PRC_CI_AS,letter nchar(1))
insert @t select 'ß¹','A' union all select '°Ë','B'
union all select 'àê','C' union all select '咑','D'
union all select '妸','E' union all select '·¢','F'
union all select 'ê¸','G' union all select 'îþ','H'
union all select 'Ø¢','J' union all select 'ßÇ','K'
union all select 'À¬','L' union all select '嘸','M'
union all select '拏','N' union all select 'àÞ','O'
union all select '妑','P' union all select 'Æß','Q'
union all select '呥','R' union all select 'Øí','S'
union all select 'Ëû','T' union all select '屲','W'
union all select 'Ϧ','X' union all select 'Ѿ','Y'
union all select '帀','Z'
select @strlen=len(@str),@re=''
while @strlen>0
begin
select top 1 @re=letter+@re,@strlen=@strlen-1
from @t a where chr<=substring(@str,@strlen,1)
order by chr desc
if @@rowcount=0
select @re=substring(@str,@strlen,1)+@re,@strlen=@strlen-1
end
return(@re)
end
go
--²âÊÔ
select dbo.f_GetPy('¶«Ý¸ÊÐ') as ¶«Ý¸ÊÐ,dbo.f_GetPy('abÖÐc¹úÈË') as ÖйúÈË
--ÒÔºó²éѯµÄʱºò,¾Í¿ÉÒÔµ÷ÓÃÉÏÃæµÄº¯ÊýÀ´ÊµÏÖºº×ÖÄ£ºý²éѯ
select * from ±í where dbo.f_getpy(×Ö¶Î)='zgyh'


Ïà¹ØÎĵµ£º

SQL Server Ë÷Òý½á¹¹¼°ÆäʹÓã¨Ò»£©

Ò»¡¢ÉîÈëdz³öÀí½âË÷Òý½á¹¹
¡¡¡¡Êµ¼ÊÉÏ£¬Äú¿ÉÒÔ°ÑË÷ÒýÀí½âΪһÖÖÌØÊâµÄĿ¼¡£Î¢ÈíµÄsql serverÌṩÁËÁ½ÖÖË÷Òý£º¾Û¼¯Ë÷Òý£¨clustered index£¬Ò²³Æ¾ÛÀàË÷Òý¡¢´Ø¼¯Ë÷Òý£©ºÍ·Ç¾Û¼¯Ë÷Òý£¨nonclustered index£¬Ò²³Æ·Ç¾ÛÀàË÷Òý¡¢·Ç´Ø¼¯Ë÷Òý£©¡£ÏÂÃæ£¬ÎÒÃǾÙÀýÀ´ËµÃ÷һϾۼ¯Ë÷ÒýºÍ·Ç¾Û¼¯Ë÷ÒýµÄÇø±ð£º
¡¡¡¡Æäʵ£¬ÎÒÃǵĺºÓï×ÖµäµÄÕ ......

±ÊÊÔSQLÓï¾ä——ѧϰ±Ê¼Ç

¶¨Ò壺
create table ±íÃû£¨ÁÐÃû1 ÀàÐÍ [not null] [,ÁÐÃû2 ÀàÐÍ] [not null]£¬···£© [ÆäËû²ÎÊý]
Ð޸ģº
alter table ±íÃû add ÁÐÃû ÀàÐÍ
alter table ±íÃû rename column Ô­ÁÐÃû to ÐÂÁÐÃû
alter table ±íÃû alter column ÁÐÃû ÀàÐÍ [£¨¿í¶È£© [£¬Ð¡Êýλ]]
alter table ±íÃû drop column ÁÐÃû ......

SQL´óÈ«

Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database dbname
3¡¢ËµÃ÷£º±¸·Ýsql server
--- ´´½¨ ±¸·ÝÊý¾ÝµÄ device
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'
--- ¿ªÊ¼ ±¸·Ý
BACKUP DATABASE pubs TO testBack
4¡¢Ëµ ......

hibernate ´òÓ¡SQLÓï¾äµ½¿ØÖÆÌ¨

Ö»ÐèÒªÔÚÅäÖÃÎļþÀï         hibernate.show_sql=true
    <property name="hibernateProperties">
      <value>
        hibernate.dialect=org.hibernate.dialect.Oracle9Dialect ......

·ÀÖ¹sql×¢Èë ÊÊÓÃÓÚ URL ID ´¿Êý×Ö

Àý×Ó£º  int id = Convert.ToInt32(replace((Request.QueryString["id"]), ""));
    public static string replace(string str, string str2)
    {
        str = str.Replace(";", str2);
        str = ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ