| Comment | SQLServer User-Defined Function
PURPOSE
Check if file exists.
Return value (BIT):
0 (False) - File does not exist
1 (True) - File exists
EXAMPLES
SELECT dbo.fun_FileExist('C:\oneTouch_drive.cvf')
1
SELECT dbo.fun_FileExist('C:\xxxx.txt')
0
-- IIF is available starting with SQL Server 2012
PRINT IIF(dbo.fun_FileExist('C:\oneTouch_drive.cvf')=1,'Yes','No')
Yes
HISTORY
2015-11-24 - Created function
2024-02-09 - Changed history table
2026-01-23 - Changed return value type to BIT
TAGS
<program>
<description>Check if file exists</description>
<generic>1</generic>
<author>Gerrit Mantel</author>
<created>2015-11-24</created>
<lastmodified>2026-01-23</lastmodified>
</program> |