Wednesday, March 21, 2012

Import directory structure to table

I need to be able to import a directory file list into a sql table.
i.e. table contains fields for filename, date etc...
is this possible?
thanks?absolutely. you are going to have to use file system objects with sp_OACreate. A solution was posted here a long time ago but the thread may have been lost when the server crashed.|||absolutely. you are going to have to use file system objects with sp_OACreate. A solution was posted here a long time ago but the thread may have been lost when the server crashed.

Nah...

http://weblogs.sqlteam.com/brettk/archive/2005/06/28/6895.aspx|||That lastone works Brett, but I can't get it to traverse sub-directories

what I am trying to do is index a hard drive of images for a real estate database.|||Drawback of letting SQL Server do this is that the directory must be on de server of SQL has to have access to remote locations.

My first instinct would have been to write a vbs-script (with a filesystemobject and ado connection) that scans the directories and inserts them in the table. This script could be run from any computer that has network access to the SQL Server.|||Lexiflex, the SQL server has access to the iages via a maped drive.

We will use this to link the image to the realtor, the listing and image history. The idea is that we want to be able to take image submissions, identify if there already are images for the property, if not add it to the listing, if there is add a flag to the listing indicating a change etc...

there is another app run from a web page that automatically places the images in the folder, and names, numbers them appropriatly|||So it should be possible to do this in SQL server.

Just curious: How do you identify which newly found image belongs to what property? And do you keep the images on the filesystem or do you import them in the database?|||The images are named with the ListingID#, and are stored in the file system.|||Good luck with this project! It's always fun to build something and see it at work afterwards. :)|||well, just iterate through the Directory table until @.@.ROWCOUNT = 0

No comments:

Post a Comment