日期:2014-05-17 浏览次数:20545 次
if OBJECT_ID('tempdb..#dir') is not null
drop table #dir
create table #dir
(
dir varchar(1000),
depth int,
is_file int
)
insert into #dir
execute master..xp_dirtree 'c:',1,1
declare @s varchar(8000)
select @s = ISNULL(@s+',','')+dir from #dir
where dir like '%.bin'
print @s