Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Function and SP to find if file/directory exists

By Simon Sabin,

This function and stored procedure can be used to easily identify if a file, directory or parent directory exist.
It wraps the functionality of xp_fileExist but gives easy access to the directory and parent directory exist values.

To use it the function pass in the file or path and either 'IsFile', 'IsDir' or 'HasParentDir' it will return 1 if true.

Total article views: 2560 | Views in the last 30 days: 11
 
Related Articles
FORUM

Shared Directory

Shared Directory

FORUM

"function"

"function"

FORUM

Active Directory

Adding active directory groups

FORUM

Function within a function

Functions

FORUM

Manipulating Integer8 (Active Directory)

Querying Active Directory via a link server and ADsDSOObject

Tags
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones