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

SQLServerÅúÁ¿µ¹ÈëĿ¼Îļþ ÊÕ²Ø


¿ÉÒÔÓÃÀ©Õ¹´æ´¢¹ý³Ìxp_dirtree»ñÈ¡ÎļþÁÐ±í£¬ÓÃopenrowsetµ¹ÈëÊý¾Ýµ½¶þ½øÖÆ×ֶΡ£
openrowsetµÄÓ÷¨¿ÉÒԲο¼msdn
http://technet.microsoft.com/zh-cn/library/ms190312.aspx
Èç¹ûÎļþºÜ¶à£¬½¨Ò黹ÊÇÓóÌÐòµ¹ÈëÁË
if (object_id ('t_bulkResult' ) is   not   null )
drop table t_bulkResult
create table t_bulkResult (name varchar (1000 ), data image )
go
declare @d varchar (1000 )
set @d = 'c:\test\'
create table #tb (fName varchar (1000 ), d int , f int )
insert into #tb exec xp_dirtree @d , 1 , 1
delete from #tb where f <> 1
declare @ sql nvarchar (max )
select @ sql = isnull (@ sql , '' )+ 'insert into t_bulkResult select ''' +@d + fname + ''',* from openrowset(bulk N''' +@d + fName + ''', SINGLE_BLOB) b
'
from #tb a
exec sp_executesql @ sql
drop table #tb
select * from t_bulkResult


Ïà¹ØÎĵµ£º

SQLSERVERÊý¾Ý¿â»¹Ô­ÊµÕ½

1£©Ð½¨Êý¾Ý¿âRESTORE
2£©ÔÚ¸ÃÊý¾Ý¿âÉÏÑ¡Ôñ£ºÈÎÎñ->»¹Ô­->Êý¾Ý¿â
3£©ÔÚ»¹Ô­Êý¾Ý¿â-RESTOREµÄ¶Ô»°¿òÖÐ
   Ä¿±êÊý¾Ý¿âÊÇRESTORE
   Ö¸¶¨ÓÃÓÚ»¹Ô­µÄ±¸·Ý¼¯µÄÔ´ºÍλÖÃ->Ô´É豸->Ñ¡Ôñ×îºóÒ»¸öÍêÈ«µÄ±¸·ÝBAKÎļþ
   ¹´Öл¹Ô­CheckBox
4£©Ñ¡Ôñ×óÉϽǵÄÑ¡Ïî
   ÔÚ»¹Ô­Ñ ......

SQLServer¸ß¼¶±à³Ì

         ±¾ÆªÄÚÈÝϵÊôSQLServer¸ß¼¶±à³Ì£¬ÊÊÓÃÓÚÓûÌá¸ß×Ô¼ººÍ¸´Ï°»òÓ¦¸¶ÃæÊÔµÄÅóÓÑÔĶÁ£¬Í¬Ê±±¾ÈËѧϰ²»¾Ã£¬ÔÚ×ܽáºÍ¹éÄÉʱ´íÎóºÍ²»Ç¡µ±Ö®´¦ÔÚËùÄÑÃ⣬»¹ÇëÖ¸³öÆäÖБ¶ËÄß’£¬ÓèÒÔÍêÉÆ¡£
±í1:Users
USE [Wish]
GO
/****** ¶ÔÏó: Table [dbo].[Users] ½Å±¾ÈÕÆÚ: ......

SqlServer ʵÏÖÈÕÆÚ²»Í¬¸ñʽµÄת»»£¡£¡

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

ÒÔÉÏ´úÂëʵÏֵĹ¦Ä ......

sqlserver·ÖÒ³´æ´¢¹ý³ÌµÄÓ÷¨

create proc P_QuerySplit
 @sqlscript varchar(20),         --±íÃû/SQLÓï¾ä
 @pageSize int,                  --ÿҳ¼Ç¼Êý
 @pageIndex int,   &nbs ......

SQLServer»ñȡÿ×éÇ°10%µÄÊý¾Ý

sqlserver2005Óйؼü×Öntile(x)ºÍover(partition by.. order by..)×Ó¾äÅäºÏ.
±ÈÈç»ñȡÿ¸ö±íµÄÇ°10%¸ö×ֶΡ£
select id , name , colid , rn from (
select * , rn = ntile (10 )
    over (partition by id order by colorder )
from syscolumns )t where rn = 1 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ