all groups > sql server programming > september 2003 >
You're in the

sql server programming

group:

xp_fileexist


Re: xp_fileexist oj
9/11/2003 8:13:45 PM
sql server programming:
Here is an example for you.

declare @i int, @f varchar(255)
declare cc cursor fast_forward
for select filename
from sysfiles
open cc
fetch next from cc into @f
while @@fetch_status=0
begin
exec master..xp_fileexist @f, @i out
if @i=1
print(rtrim(@f)+' exists')
else
print(rtrim(@f)+' not exist')
fetch next from cc into @f
end
close cc
deallocate cc


--
-oj
RAC v2.2 & QALite!
http://www.rac4sql.net



[quoted text, click to view]

xp_fileexist mirage00
9/11/2003 10:39:00 PM
the table has a varchar column with filenames in it... I want a script that
iterates through the table and checks to see if the file exists... HELP!
Thanks in advance

AddThis Social Bookmark Button