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
 General SQL Server Forums
 New to SQL Server Programming
 Scanning Directories and Copying file names etc

Author  Topic 

Bill_C
Constraint Violating Yak Guru

299 Posts

Posted - 2008-08-07 : 08:23:01
Anyone know how i can scan directories on the server for file changes and then write the results to a table?

Thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-08-07 : 09:11:09
Do a "DIR /S" in a command shell xp_cmdshell and output the result into a temporary table.



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

Bill_C
Constraint Violating Yak Guru

299 Posts

Posted - 2008-08-07 : 09:51:35
What about files in a directory on a different server?

Can you give an example please?
Thanks
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-08-07 : 10:24:46
xp_cmdshell supports UNC paths.



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

- Advertisement -