Here's a script I wrote a while ago that might work for you:declare @sql varchar(8000)select @sql=''create table #dbfiles(db varchar(50) not null, name varchar(50) not null, filename varchar(128) not null)create table #files(filename varchar(128) null)exec sp_msforeachdb 'insert into #dbfiles(db, name, filename) select ''?'', name, filename from ?..sysfiles'select @sql=@sql+'exec master..xp_cmdshell ''for %a in (' + a.path + '*.*) do @echo %a'';' from (select distinct reverse(substring(reverse(filename), charindex('\',reverse(filename)), 8000)) as path from #dbfiles) ainsert into #files exec(@sql)select f.* from #files f left join #dbfiles d on f.filename=d.filename where d.filename is nulldrop table #filesdrop table #dbfiles