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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 compare field with list of files on hard disk

Author  Topic 

mimic
Starting Member

18 Posts

Posted - 2008-01-21 : 04:26:03
Hi!

I have a problem. I have in a table field that contains path to files on disk share(\\server1\share1\directory1\file1.txt). The problem is that some of those entries in that field are not correct or the file is simple missing. I would need to write a query that compares the entries in that field with the files contain in a directory and subdirectories. If the value in that field can't be matched with a file then it should be writen into another table.
So i need a list of entries of that field that can't be found in the directory(files).

Can anyone help me?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-01-21 : 04:29:55
sp_fileexists



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

mimic
Starting Member

18 Posts

Posted - 2008-01-21 : 05:55:10
I'm not an expert
i need a bit more, please!
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-01-21 : 06:18:52
Create a WHILE loop and for each and one of the files to check, execute the SP mentioned above.

Or do you want me to write all the code for you?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

mimic
Starting Member

18 Posts

Posted - 2008-01-25 : 02:43:46
Yes, please!
Go to Top of Page

mimic
Starting Member

18 Posts

Posted - 2008-02-04 : 04:11:33
Can anyone help me?
Go to Top of Page
   

- Advertisement -