declare@Path varchar(128) ,
@FileName varchar(128)
select@Path = \\ServerName\ShareName\' ,
@FileName = 'file.txt'
declare @fe int
declare@File varchar(1000)
select @File = @Path + @FileName
exec master..xp_fileexist @File, @fe out
if @fe = 1
print 'exists'
else
print 'not exists'