zoukankan      html  css  js  c++  java
  • 有用sql语句一

     1 DECLARE
     2  @retval int,
     3  @param1 int
     4  EXECUTE @retval=master.dbo.xp_fileexist 'D:TkSoftSamplePicFabricImgA1NC8606.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:TkSoftSamplePicFabricImg'+@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
  • 相关阅读:
    noi.openjudge——2971 抓住那头牛
    P1265 公路修建 洛谷
    P2330 [SCOI2005] 繁忙的都市 洛谷
    P1331 海战 洛谷
    P1464 Function 洛谷
    基于Manhattan最小生成树的莫队算法
    zoj3659
    poj1182
    hdu1325
    hdu3635
  • 原文地址:https://www.cnblogs.com/ChineseMoonGod/p/5966686.html
Copyright © 2011-2022 走看看