Fog Creek Software
Discussion Board

SQLServer remote query of filesystem

Does SQLServer allow remote queries on filesystems on the local area network for document searching and indexing?I know there is a Scope keyword which does local filesystem scope.Does it also work for remote filesystems?

Monday, April 26, 2004

Extended stored procedures may be able to access network resources.  The simplest example to test with is xp_cmdshell.  Try something like:

exec master..xp_cmdshell 'dir \\someserver\sharename\*.*'

Note that this requires UNC names, not mapped drive letters.  Mappings relate to loging in, and there is no logging in for this case; it is being executed by the service, under the rights of the account under which the service runs.  Note also that since xp_cmdshell is so powerfull there are restrictions on who may execute it - see the docs.

Monday, April 26, 2004

Also search for:


Bill Carlson
Monday, April 26, 2004

*  Recent Topics

*  Fog Creek Home