Home All Groups Group Topic Archive Search About

Verfy file path from SQL 2k

Author
9 Dec 2005 2:37 PM
Ben
Hi

We have a number of documents references in our SQL Database and i would
like to occasionally run a script directly from Query Analyser to identify
missing documents.

The database holds the UNC Path \\servername\sharename\document.doc

Is this possible?

Thanks
B

Author
9 Dec 2005 3:29 PM
JT
I'm sure there is a method for writing a T-SQL script that can run from
Query Analyzer and iterate through a cursor while checking for the existence
of files located on the server.

However, for this type of general programming stuff, I would instead suggest
using the Windows Scripting Host. Perhaps write a VB script that queries the
list of documents into an ADO recorset and then uses the FileExists method
of the File System Object. This can be run from a workstation using a UNC
path or run directly on the server via Remote Console.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsoriWindowsScriptHost.asp

http://www.4guysfromrolla.com/webtech/101399-1.shtml

http://msdn.microsoft.com/msdnmag/issues/01/05/sqldmo/


Show quote
"Ben" <B**@Newsgroups.microsoft.com> wrote in message
news:OcRIT5M$FHA.1032@TK2MSFTNGP09.phx.gbl...
> Hi
>
> We have a number of documents references in our SQL Database and i would
> like to occasionally run a script directly from Query Analyser to identify
> missing documents.
>
> The database holds the UNC Path \\servername\sharename\document.doc
>
> Is this possible?
>
> Thanks
> B
>
>

AddThis Social Bookmark Button