SQL 2000: only select records where xp_fileexist = true?
imagine i have a table called tbl_pictures: picture_id and picture_name and there are about 500 records in that table. The pictures are stored in c:\mypics\

The problem: not all photos exists anymore, but they ARE still in the table.
How can i list only those pictures that DO exist?

I do know how to check if a single file exists with "EXEC Master.dbo.xp_fileexist @filename", but i don't know how to do it in a loop.

It should look something like below:
SELECT picture_name FROM tbl_pictures WHERE (xp_fileexist '@picture_name' = true)

Anyone? :)
SQL 2000: only select records where xp_fileexist = true?
===

imagine i have a table called tbl_pictures: picture_id and picture_name and there are about 500 records in that table. The pictures are stored in c:\mypics\

The problem: not all photos exists anymore, but they ARE still in the table.
How can i list only those pictures that DO exist?

I do know how to check if a single file exists with "EXEC Master.dbo.xp_fileexist @filename", but i don't know how to do it in a loop.

It should look something like below:
SELECT picture_name FROM tbl_pictures WHERE (xp_fileexist '@picture_name' = true)

Anyone? :)