RT

解决方案 »

  1.   

    如果你非要在SQL SERVER里做,你必须开启xp_cmdshelldeclare @t table(col varchar(1000))
    declare @dirpath varchar(256)set @dirpath = 'f:\1'  --目录路径
    insert @t exec('xp_cmdshell ''dir '+@dirpath+'''')
    if exists(
    select *
    from @t
    where col = 'File Not Found')  --我是英文版操作系统,中文的应该是“文件目录没找到"把(自己DOS下测试一下)
    exec('xp_cmdshell ''md '+@dirpath+'''')还有一种方法就是用OLE对象创建,这个网上自己搜索了