将没有产品图片的产品设置为不在前台显示SQL实现

mac2022-06-30  15

-- 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

转载于:https://www.cnblogs.com/seerlin/archive/2011/05/11/2043018.html

最新回复(0)