Phill,
xp_dirtree combined with xp_getfiledetails may do the job for you.
eg. EXECUTE master.dbo.xp_dirtree N'C:\TEMP\', 1, 1
one of the columns returned will say whether the entry is a subdirectory or a file.
To get file details:
CREATE TABLE #FileInfo (
alt_name varchar(255) null,
size_in_bytes int null,
creation_date int null,
creation_time int null,
last_written_date int null,
last_written_time int null,
last_accessed_date int null,
last_accessed_time int null,
attributes int null
)
INSERT #FileInfo EXEC master.dbo.xp_getfiledetails @Filename
Cheers,
- Mark