Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
joblenis
Starting Member
29 Posts |
Posted - 2007-11-01 : 11:18:05
|
| Hey guys,I have a procedure that runs everyday which takes the IIS log file from the previous day and imports it and calcs values. I would like to change this from taking the previous day to scanning all the file names in the folder and comparing them to a database to see if they have already been scanned before. I already have a table called DatesScanned which lists the filename and scandate.IE:D:\Logs\file1.logD:\Logs\file2.logD:\Logs\file3.logD:\Logs\file4.logThe 4 file names will be scanned and compared to DatesScanned to see which has been imported already.Can anyone point me to a resource or information on how I would get the directory listing of a folder so I could compare it to the DatesScanned table.Thanks a bunch!Jeff |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-11-01 : 11:42:57
|
| you can use xp_cmdshell to run command line and return the results to a table_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
joblenis
Starting Member
29 Posts |
Posted - 2007-11-01 : 12:20:44
|
| Thanks! Ok I got that to run, now I need to filter it so it only shows the filename. Then I will need to query it against the other table and export the filenames that have not been imported to a file. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
joblenis
Starting Member
29 Posts |
Posted - 2007-11-01 : 15:10:44
|
| Thanks for the article :) |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|