Blog Pages

TSQL command - Get list of files in a folder

declare @files table (ID int IDENTITY, FileName varchar(100))
insert into @files execute xp_cmdshell 'dir \\\Public\itai'
select * from @files
       where FileName like '%.DAT%' -- filters

No comments:

Post a Comment