Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Master.dbo.xp_fileexist in sql

Master.dbo.xp_fileexist in sql

Scheduled Pinned Locked Moved Database
questiondatabasehelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vanikanc
    wrote on last edited by
    #1

    Hi, I have a stored proc, which converts a pdf to tiff files. Now, I need to rename these tiff files. The main file name is maintained but the last part of the file name changes to xxx00001.tif - xxx is my file name. How can I check if the main part of the file exists, just xxx part so I can rename it? When I use the fileexist, it looks for the entire filename and hence not finding the file. any help is appreciated.

    L 1 Reply Last reply
    0
    • V vanikanc

      Hi, I have a stored proc, which converts a pdf to tiff files. Now, I need to rename these tiff files. The main file name is maintained but the last part of the file name changes to xxx00001.tif - xxx is my file name. How can I check if the main part of the file exists, just xxx part so I can rename it? When I use the fileexist, it looks for the entire filename and hence not finding the file. any help is appreciated.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      vanikanc wrote:

      How can I check if the main part of the file exists, just xxx part so I can rename it? When I use the fileexist, it looks for the entire filename and hence not finding the file.

      Get the directory contents by using [xp_cmdshell](http://msdn.microsoft.com/en-us/library/aa175921%28v=sql.80%29.aspx)[[^](http://msdn.microsoft.com/en-us/library/aa175921%28v=sql.80%29.aspx "New Window")], and check whether there's a recently created file that meets the criteria.

      Bastard Programmer from Hell :suss:

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups