Home Forums SQL Server 2005 Development Pulling Filename from Windows directory into table RE: Pulling Filename from Windows directory into table

  • Nevermind;

    I figured out how to get rid of the trailing spaces within my batch file...

    Hi Jeff,

    That works great. The only problem I'm having with this is that the results seem to have a lot of trailing spaces in it.

    I tried to edit the following portion of your query but they are still showing up:

    SELECT rtrim(FileName) FROM #FileList WHERE Extension = '.txt' AND IsFile = 1

    EXCEPT

    SELECT rtrim(FileName) FROM #FileList WHERE Extension = '.pdf' AND IsFile = 1

    I'm sending the results of this to a text file that is referenced in a batch file to trigger a conversion and the trailing spaces are killing it.

    Also how difficult would it be to add the .txt extension back to the filename after checking. I tried to add Extension back in to the select but it says it needs to be in both. When adding it to both it obviously breaks the check from happening.