info@techdevops.com
TechDevOps.com
Explore Tools
Experts in Microsoft SQL Server Operations, Performance, Replication, Cloud & Migrations



SQL Server 2017 - sys.dm_os_file_exists
by BF (Senior MSSQL Operations - Enterprise, Cloud, Strategy)
2017-06-23









T-SQL:


File Exists:
xp_fileexist:
EXEC xp_fileexist 'C:\Program Files\Microsoft SQL Server\140\Tools\Binn\SqlLogShip.exe'

sys.dm_os_file_exists:
SELECT * FROM sys.dm_os_file_exists('C:\Program Files\Microsoft SQL Server\140\Tools\Binn\SqlLogShip.exe');


File does not exist:
xp_fileexist:
EXEC xp_fileexist 'C:\Program Files\Microsoft SQL Server\140\Tools\Binn\SqlLogShip_exe'

sys.dm_os_file_exists:
SELECT * FROM sys.dm_os_file_exists('C:\Program Files\Microsoft SQL Server\140\Tools\Binn\SqlLogShip_exe');