SqlserverµÃµ½ºº×ÖÆ´ÒôÊ××Öĸ´æ´¢¹ý³Ì
SqlserverµÃµ½ºº×ÖÆ´ÒôÊ××Öĸ´æ´¢¹ý³Ì:
create function [dbo].[fun_getPY]
(
@str nvarchar(4000)
)
returns nvarchar(4000)
as
begin
declare @word nchar(1),@PY nvarchar(4000)
set @PY=''
while len(@str)>0
begin
set @word=left(@str,1)
--Èç¹û·Çºº×Ö×Ö·û£¬·µ»ØÔ×Ö·û
set @PY=@PY+(case when unicode(@word) between 19968 and 19968+20901
¡¡then (select top 1 PY from (
¡¡select 'A' as PY,N'æñ' as word
union all select 'B',N'²¾'
union all select 'C',N'´í'
union all select 'D',N'鵽'
union all select 'E',N'樲'
union all select 'F',N'öû'
union all select 'G',N'腂'
union all select 'H',N'夻'
union all select 'J',N'攈'
union all select 'K',N'穒'
union all select 'L',N'鱳'
union all select 'M',N'旀'
union all select 'N',N'桛'
&nb
Ïà¹ØÎĵµ£º
Êý¾ÝÀï(sqlserver) µÄ²Ù×÷ £º
eg £º2008-3-31 10:34 --> 2008-3-31
Ò».½ØÈ¡×Ö·û´®·½Ê½
select substring('2008-3-31 10:34',0,charindex(' ','2008-3-31 10:34'))
¶þ.
Select
CONVERT(varchar, getdate(), 1),--mm/dd/yy
CONVERT(varchar, getdate(), 2),--yy.mm.dd
CONVERT(varchar, getdate() ......
MS SQL Server²éѯÓÅ»¯·½·¨
²éѯËÙ¶ÈÂýµÄÔÒòºÜ¶à£¬³£¼ûÈçϼ¸ÖÖ
1¡¢Ã»ÓÐË÷Òý»òÕßûÓÐÓõ½Ë÷Òý(ÕâÊDzéѯÂý×î³£¼ûµÄÎÊÌ⣬ÊdzÌÐòÉè¼ÆµÄȱÏÝ)
2¡¢I/OÍÌÍÂÁ¿Ð¡£¬ÐγÉÁËÆ¿¾±Ð§Ó¦¡£
& ......
MS Sqlserver 2005 ¼¯ÈºÊÇÖ¸Êý¾Ý¿â¸ß¿ÉÓÃÐÔ¼¯Èº£¬ÄÜʵÏÖͨ³£Ëù˵µÄ“Ë«»úÈȱ¸”£¬¼´µ±Ò»Ì¨·þÎñÆ÷Í£µôÊý¾Ý¿â·þÎñ¿ÉÒÔ×Ô¶¯×ªÒƵ½Áíһ̨·þÎñÆ÷¡£
»·¾³ÒªÇó£º
1¡¢windows 2003 serverÆóÒµ°æ
&nb ......
ÔÚSQL Server ÖвåÈëÒ»ÌõÊý¾ÝʹÓÃInsertÓï¾ä£¬µ«ÊÇÈç¹ûÏëÒªÅúÁ¿²åÈëÒ»¶ÑÊý¾ÝµÄ»°£¬Ñ»·Ê¹ÓÃInsert²»½öЧÂʵͣ¬¶øÇһᵼÖÂSQLһϵͳÐÔÄÜÎÊÌâ¡£ÏÂÃæ½éÉÜSQL ServerÖ§³ÖµÄÁ½ÖÖÅúÁ¿Êý¾Ý²åÈë·½·¨£ºBulkºÍ±íÖµ²ÎÊý(Table-Valued Parameters)¡£
ÔËÐÐÏÂÃæµÄ½Å±¾£¬½¨Á¢²âÊÔÊý¾Ý¿âºÍ±íÖµ²ÎÊý¡£
´úÂëÈçÏÂ:
--Create D ......
select
convert(char(4),auth,120)+'Äê'+
substring(convert(char(10),auth,120),6,2)+'ÔÂ'+
substring(convert(char(10),auth,120),9,2)+'ÈÕ',
convert(char(4),appr,120)+'Äê'+
substring(convert(char(10),appr,120),6,2)+'ÔÂ'+
substring(convert(char(10),appr,120),9,2)+'ÈÕ'
from a
ÒÔÉÏ´úÂëʵÏֵĹ¦Ä ......