I am creating a stored procedure that will update a table from the current contents of a specified directory based on the last time the stored proc ran. I am using the following to create the temp table:
create table #tmp(result varchar(255))
insert into #tmp exec xp_cmdshell 'dir c:\[path]'
However, this returns the results of the 'dir' cmd to one result column and, the only data that I need is the file names. I'm not positive this is even the best method to achieve my desired results. Does anyone have comments or an alternate solution?