Link to home
Start Free TrialLog in
Avatar of mojoinc
mojoinc

asked on

determining files with 0 bytes in transact SQL

I have a need to determine the length of flat files before I import them into SQL Server.  I currently determine which files to load by a DIR command thru xp_cmdshell.  I have run into a problem where some files have 0 bytes and I want to exclude those.  How can determine the file size in transact SQL?  
xp_cmdshell 'dir c:\directory\ /B'  this is what I currently use but it only returns the file names.  Haven't figured out how to determine the 0 length files

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of BrandonGalderisi
BrandonGalderisi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial