Código SQL:
Ver originalCREATE TABLE #Files
(
ROW VARCHAR(400)
)
INSERT #Files
(
ROW
)
EXEC master..xp_cmdshell 'DIR D:\EvaluationsUnit\FertilityIndexAnimalModelMixFiles\hol\test.dat /s'
SELECT fileName,
fileSize
FROM (
SELECT SUBSTRING(ROW, 37, 400) AS fileName,
REPLACE(REPLACE(SUBSTRING(ROW, 18, 19), CHAR(160), ''), CHAR(32), '') AS fileSize
FROM #Files
) AS d
WHERE fileSize NOT LIKE '%[^0-9]%'
Ya si quieres hacerlo con sql server aqui hay un ejemplo :)