Check if a file exist in a Query!

  • Hello!

    Are there any functions in SQL that tells me if a file in a dir exists or not?

    What's the synax?


    -Lars

    Please only reply to this newsgroup. All mails would be bounced back.

  • http://www.itrain.de/knowhow/sql/tsql/xp/xp_dir.asp has some examples on how to do this. It's in German, but the code speaks for itself. Note that these procedures are ostly undocumented, so here goes the usual warning to be careful. An alternative might be to use xp_cmdshell and the good old DOS command DIR.

     

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

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