--select * from Product where ProCode='DWIHEE00108'

--declare @result int
--
exec xp_fileexist 'C:\test\testsdfs.txt',@result output 

--select @result

declare @result int,@proid uniqueidentifier,@proimgurl1 nvarchar(100)

declare myCursor cursor for
    
select proid,proimgurl1 from product
    
open myCursor
fetch myCursor into @proid,@proimgurl1

while @@FETCH_STATUS=0
begin
set @proimgurl1='C:/Project/website/DowellinWebsite'+@proimgurl1
exec xp_fileexist @proimgurl1,@result output 
if (@result=1)
    
update Product set IsShow=1 where ProId=@proid
else
    
update Product set IsShow=0 where ProId=@proid
fetch myCursor into @proid,@proimgurl1
end
close myCursor
deallocate myCursor

相关文章:

  • 2021-11-27
  • 2021-12-26
  • 2021-05-18
  • 2022-01-04
  • 2021-11-25
  • 2021-07-20
  • 2021-08-11
  • 2021-09-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2021-10-22
  • 2021-11-23
  • 2021-09-28
相关资源
相似解决方案