xp_fileexist find a file accross network

  • How can I find a file exist accross the NT network using xp_fileexist.

    network path: \\backup\04032003.bak

    I tried:

    declare @result int

    master..xp_fileexist '\\backup\04032003.bak' @result output

    return: @result=0

    Is anything wrong with the network path?

  • There doesn't seem to be anything wrong with the path.

    Does SQL Server run as the system account (in which case it has no network access), or as a domain account (if so, does that account have access to the network directory)

  • Change the return statement:

    declare @result int

    master..xp_fileexist '\\backup\04032003.bak' @result output

    return

    -- Returns 1 if file exists, 0 if it doesn't

    Jeremy

    Jeremy

  • Thanks, ianscarlett.

    You are right. The account I tried was a remote PC access network via VPN and it does not have access to the network direcotry. It works if I use the system account.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply