一、xp_fileexist调用说明
1、
xp_fileexist "c:\autoexec.bat"
File Exists File is a Directory Parent Directory Exists
----------- ------------------- -----------------------
1 0 1
--1表存在,0表不存在
(1 row(s) affected)
------------------------------------------
2、
declare @result int
exec xp_fileexist 'c:\autoexec.bat', @result output
@result=1表文件存在
@result=0表文件不存
二、测试
if exists (select *
from sysobjects
where type='u'
and
name = 'temp_xp_fileexist')
begin
drop table temp_xp_fileexist
end
create table temp_xp_fileexist(a bit,b bit,c bit)
--declare @sql nvarchar(1000)
--set &#