info@techdevops.com | 437-991-3573 | Data Engineering Services
TechDevOps.com
Resources Tools
Experts in Microsoft SQL Server on Windows, Linux, Containers | Clusters, Always On, FCI | Migrations, Cloud, Performance



SQL Server 2017 - sys.dm_os_file_exists
by BF (Principal Consultant; Architecture; Engineering)
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');