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

有用sql语句一

时间:2016-10-16 16:14:19      阅读:223      评论:0      收藏:0      [点我收藏+]

标签:

 1 DECLARE
 2  @retval int,
 3  @param1 int
 4  EXECUTE @retval=master.dbo.xp_fileexist D:\TkSoft\SamplePic\FabricImg\A1NC8606.BMP, @param1 OUTPUT 
 5  IF @param1 = 0
 6  PRINT File does not exist!
 7  ELSE
 8  PRINT File exists! 
 9  
10  
11  select * into samp
12 from  openrowset(SQLOLEDB, 192.168.0.180; sa; hualong2012, soyerp.dbo.samp) 
13 
14 
15 
16 declare @auid nvarchar(50)
17 declare auth_cur cursor for
18 select replace(花型编号, ," ")  
19 from samp
20 open auth_cur
21 fetch next from auth_cur into @auid
22 while (@@fetch_status=0)
23   begin
24    DECLARE
25  @retval int,
26  @param1 int,
27  @name nvarchar(200)
28  set @name=D:\TkSoft\SamplePic\FabricImg\+@auid+.BMP
29  EXECUTE @retval=master.dbo.xp_fileexist @name, @param1 OUTPUT 
30  IF @param1 = 0
31  print @auid
32     fetch next from auth_cur into @auid
33   end
34 close auth_cur
35 deallocate auth_cur

 

有用sql语句一

标签:

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

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