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