Home Forums SQL Server 2005 Development Pulling Filename from Windows directory into table RE: Pulling Filename from Windows directory into table

  • 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


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)