--
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
转载请注明原文地址: https://mac.8miu.com/read-30706.html