码迷,mamicode.com
首页 > 数据库 > 详细

经典sql

时间:2016-08-20 17:30:56      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:

DECLARE
 @retval int,
 @param1 int
 EXECUTE @retval=master.dbo.xp_fileexist D:\TkSoft\SamplePic\FabricImg\A1NC8606.BMP, @param1 OUTPUT 
 IF @param1 = 0
 PRINT File does not exist!
 ELSE
 PRINT File exists! 
 
 
 select * into samp
from  openrowset(SQLOLEDB, 192.168.0.180; sa; hualong2012, soyerp.dbo.samp) 



declare @auid nvarchar(50)
declare auth_cur cursor for
select replace(花型编号, ," ")  
from samp
open auth_cur
fetch next from auth_cur into @auid
while (@@fetch_status=0)
  begin
   DECLARE
 @retval int,
 @param1 int,
 @name nvarchar(200)
 set @name=D:\TkSoft\SamplePic\FabricImg\+@auid+.BMP
 EXECUTE @retval=master.dbo.xp_fileexist @name, @param1 OUTPUT 
 IF @param1 = 0
 print @auid
    fetch next from auth_cur into @auid
  end
close auth_cur
deallocate auth_cur

 

经典sql

标签:

原文地址:http://www.cnblogs.com/ChineseMoonGod/p/5790736.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!