Ho Do I find List of file names on specified location in SQL Server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Prashant Mishra
    New Member
    • Jan 2012
    • 1

    Ho Do I find List of file names on specified location in SQL Server

    Is there any way or Sql Statement to find out the list of file name from a specified path.

    I want to provide a path of a folder (e.g. d:\prashant\) and Sql Statement or program should return all file names available in the d:\prashant\.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    If you input all the files, folders, and paths into a database table then yes. But I don't understand why you would want to do that much work or why you would want to store a replica of your filesystem in a SQL table.

    Comment

    • ck9663
      Recognized Expert Specialist
      • Jun 2007
      • 2878

      #3
      Do a simple "dir" in a xp_cmdshell statement. Make sure to store the result into a table.

      Happy Coding!!!


      ~~ CK

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        Do a simple "dir" in a xp_cmdshell statement. Make sure to store the result into a table.

        Happy Coding!!!


        ~~ CK

        Comment

        Working...