ÈçºÎÓÃSQL Óï¾ä¶ÁÈ¡DÅÌÄÚÈÝ
master..xp_dirtree 'D:\',1,1 µÚÒ»¸ö1ÊÇÉî¶È£¬µÚ¶þ¸ö1ÊÇÎļþ
1. Ö´ÐÐ master..xp_dirtree 'c:\',1,1,ÕâÑù¿ÉÒÔ»ñÈ¡c:\ϵÄËùÓÐÎļþºÍÎļþ¼Ð,²»°üÀ¨×ÓÎļþ¼Ð¼°Îļþ
2. ÏÔʾÔÚtreeviewÖÐ,ÓñêÖ¾Çø±ðÎļþÓëĿ¼
3. ΪËùÓеÄĿ¼´´½¨Ò»¸öÒþ²ØµÄ×Ó½áµã(ÕâÑùĿ¼¾ÍÓÐÁË+,¿ÉÒÔÕ¹¿ª)
4. Èç¹ûÓû§Õ¹¿ªÄ³¸öĿ¼,ÄÇô¼ì²éÕâ¸ö½áµãÏÂÊÇ·ñÓÐÒ»¸öÒþ²ØµÄ×Ó½áµã,Èç¹ûÓбíʾ´ÓÀ´Ã»Óд¦Àí¹ý.
µ÷ÓÃ master..xp_dirtree 'c:\<path>',1,1
ÆäÖÐpathÊǵ±Ç°µÄĿ¼ÃûÀ´µÃµ½Óû§ÒªÕ¹¿ªµÄĿ¼ÏµĵÚÒ»²ãÎļþºÍÎļþ¼Ð. ²¢Ìí¼Óµ½treeviewÖÐ,ͨ²Å²½Öè2,3µÄ´¦Àí
Èç¹ûÓû§Õ¹¿ªµÄÊÇÒѾ´¦Àí¹ýµÄĿ¼,ÔòÎÞ·¨´¦Àí.
£±£®ÏȽ«Óá¡master..xp_dirtree 'c:\',0,1¡¡½«ËùÓÐÎļþÈ¡³öÀ´£¬
£²£®È»ºó½«depth = 1µÄÑ¡Ôñ³öÀ´×÷Ϊ£ÃÅ̸ùĿ¼ÏµÄĿ¼¼°ÎļþÃû
£³£®ÔÙÓÃÑ»·Óï¾ä½«¼ÌÐøËÑË÷£¬ÀýÈç¡¡master..xp_dirtree 'c:\Windows',0,1,
¡¡Í¬Ê±ÎªËÑË÷³öÀ´µÄÎļþ¼ÓÉÏParent±ê¼Ç¡¡£®£®£®
Ïà¹ØÎĵµ£º
ÔÚ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 'àê ......
½ñÌìÁ·Ï°ÔÚJSPÒ³ÃæÖÐʵÏÖ·ÖҳЧ¹û£¬ÔÚ²éѯÓï¾ä·½ÃæÇ£³¶µ½ÁËtopµÄÓ÷¨¡£¼òÒª×öÒ»ÏÂ×ܽ᣺
ΪʵÏÖÀàËÆtopµÄ¹¦ÄÜ£¬ÎÒÃÇÔÚSQL ServerÖкÍMySQLÖÐʹÓõ½µÄSQLÓï¾äÊDz»Í¬µÄ¡£
1¡¢ÔÚSQL ServerÖУ¬ÎÒÃÇʹÓà select top N * ......
Sql Server ²éѯsqlÖ´Ðи÷¸ö½×¶ÎµÄʱ¼ä
set statistics io on
set statistics time on
set statistics profile on
go
[ÄãµÄsqlÓï¾ä]
go
set statistics io off
set statistics time off
set statistics profile off
ÎÒÔËÐУº
set statistics io on
set statistics time on
set statistics profile on ......
ÏÂÔØsql2005ÍêÒÔºó½âѹ³öÀ´£¬´ó¼Ò¿ÉÒÔ¿´µ½cs_sql_2005_chs_x86Õâ¸öĿ¼£¬½øÈëÕâ¸öĿ¼ÔËÐÐsetup.exeÎļþ£¬°²×°³ÌÐò¾Í¿ªÊ¼ÔËÐÐÁË¡£
Ê×Ïȵ¯³öÀ´µÄÊÇÈí¼þÐí¿ÉÌõ¿î
¹´ÉÏÎÒ½Ó°®Ðí¿ÉÌõ¿îºÍÌõ¼þ£¬µãÏÂÒ»²½
ÕâÀïÁгöÁËSQL2005ÔËÐл·¾³£¬Ö±½Óµã°²×°
³ÌÐò¿ªÊ¼°²×°SQL2005ÔËÐбØÐèµÄ»·¾³£¬ÅäÖÃ×é¼þ
±ØÐèµÄ×é¼þ°²×°ºÃÁË£¬µãÏÂÒ»²½¼ ......
SQLServer»ù±¾º¯Êý
1.×Ö·û´®º¯Êý £º
×Ö·û²Ù×÷Àà £º
upper(char_expr) תΪ´óд
lower(char_expr) תΪСд
UCase(string) ·µ»Ø Variant (String)£¬ÆäÖаüº¬×ª³É´óдµÄ×Ö·û´®¡£
LCase(string) ·µ»Ø×Ö·û´®µÄСдÐÎʽ¡£
space(int_expr) Éú³Éint_expr¸ö¿Õ¸ñ
replicate(char_expr,int_expr) ¸´ÖÆ×Ö·û´®int_expr´Î
......