检查文件

 
create   table   #tb(a   bit,b   bit,c   bit)  
insert   into   #tb   exec   master..xp_fileexist   'c:\boot.ini '     --c:\boot.ini是要检查的文件名  
if   exists(select   *   from   #tb   where   a=1)  
print   '有该文件 '  
else  
print   '无该文件 '  
drop   table   #tb
posted @ 2010-10-26 18:49  qanholas  阅读(165)  评论(0编辑  收藏  举报