erouse (5/17/2013)
Great procedure, thank you.If I run it on the local drive it works great.
----------
USE [master]
GO
DECLARE@return_value int
EXEC@return_value = [dbo].[GetDirDetails]
@piFullPath = N'C:\'
SELECT'Return Value' = @return_value
GO
----------
However if try to run it on a network drive no records are returned
----------
USE [master]
GO
DECLARE@return_value int
EXEC@return_value = [dbo].[GetDirDetails]
@piFullPath = N'\\ELK\Share\Dealers\'
SELECT'Return Value' = @return_value
GO
-----------
I do have security rights to read on the network drive and can browse it from the same box SQL is running on. I'm at a loss. Am I missing something here?
I just tried the code at work using a UNC and it worked fine. The only way that nothing will be returned is if the path doesn't exist, there are no files in the path, or the system doesn't have the privs to the path. To be sure, it's what the system can see... not what you can see.
--Jeff Moden
Change is inevitable... Change for the better is not.