I am using the following code 1 to check if a file exists in a folder and it works. Then when I move the file to another folder, saying adding multiple New folder, it does not work, only 0 is returned, not 1.(I am sure the path is correct and the file does exist)
I cannot figure out what is the problem.
Code 1:
DECLARE @result INT
EXEC master.dbo.xp_fileexist 'C:\Users\$11F7BC3A.jpg', @result OUTPUT
select @result as 'results'
Code 2:
DECLARE @result INT
EXEC master.dbo.xp_fileexist 'C:\Users\James.James\New folder\New folder\$11F7BC3A.jpg', @result OUTPUT
select @result as 'results'