Situatie
Pentru ca m-am lovit deseori de aceasta problema, am facut un mic script ce verifica existenta fizica a unui fiser pe storage-ul serverului de sql, in calea cautata.
Solutie
SET NOCOUNT ON
DECLARE @FilePath varchar(255)
DECLARE @File_Exists int
SELECT @FileName=’C:\bk\README.txt’
EXEC Master.dbo.xp_fileexist @FilePath, @File_Exists OUT
IF @File_Exists = 1
PRINT ‘File Found’
ELSE PRINT ‘File Not Found’
GO
Leave A Comment?