• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 192
  • Last Modified:

access director and file information via sql command

Is there a way to be able to perform select statements against a drives directories and files with out having import a text file of a dir >

  • 2
1 Solution
Gerwin Jansen, EE MVETopic Advisor Commented:
Windows directory and file information is stored in the Windows file system, to my knowledge you cannot run a SQL statement against that 'database'.

But scheduling a Windows task to create the text file that has all files and directories and importing that into a database may get you what you want.
you can run regular commands over the sql connection (dir, type, cat, ...)


you should even be able to create a view based on xp_cmdshell that will let you actually use select queries and the likes but i assume you don't actually need that.
Gerwin Jansen, EE MVETopic Advisor Commented:
@HalCHub - Does last comment above answer your question? Can you show for example how you 'select' all files with a .txt extension from a certain directory? That is what you were asking, right?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now