PharmAll
asked on
SQL xp_cmdshell to get file paths
Hi all,
This is the simplest form of xp_cmdshell that I have seen. How would I produce a table that shows the file's paths in their subfolders?
declare @files table (ID int IDENTITY, FileName varchar(100))
insert into @files execute xp_cmdshell 'dir d:\import\ /b'
select * from @files
Thanks!
This is the simplest form of xp_cmdshell that I have seen. How would I produce a table that shows the file's paths in their subfolders?
declare @files table (ID int IDENTITY, FileName varchar(100))
insert into @files execute xp_cmdshell 'dir d:\import\ /b'
select * from @files
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
And what great article - I will bookmark that one.