Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    17

    Question Unanswered: Checking existence of network file

    Hi Guys,

    Just wonder if anyone know how can I check the network file (whether exists or not) using TSQL or Extended Stored Procedures?

    What I can find out is the xp_fileexist, but it is only meant for searching file residing locally... I have tried mapping the drive of another server to the SQL server, but it just won't do it...

    Any idea?

    Thanks in advance.

    Regards,
    Tang

  2. #2
    Join Date
    Mar 2003
    Posts
    6
    I have used xp_cmdshell as follows:

    exec @result = xp_cmdshell ('dir \\server\share\filename.ext')

    if(@result = 0)

    begin
    it's there so do something
    end

    This has worked well so far...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •