检查文件

 
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
原文地址:https://www.cnblogs.com/qanholas/p/1861776.html