当前位置:七道奇文章资讯数据防范MSSQL防范
日期:2011-01-25 23:11:00  来源:本站整理

SQL中if语句的用法示例[MSSQL防范]

赞助商链接



  本文“SQL中if语句的用法示例[MSSQL防范]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:

SQL中if语句是最常见也是最常用的SQL语句之一,下面就将为您举例阐明SQL中if语句的用法,但愿对您学习SQL中if语句的利用可以有些许帮忙.

  1. _sql = " if not exists (select * from ProDesignSheet5 where Sheet5ID = '" + this.Sheet5id + "') "  
  2.               + " insert into ProDesignSheet5 values('" + this.Sheet5id  
  3.               + "','" + this.Consplacepbfee.ToString()  
  4.               + "','" + this.Searchtestfee.ToString()  
  5.               + "','" + this.Ccdesignfee.ToString()  
  6.               + "','" + this.Propreparefee.ToString()  
  7.               + "','" + this.Elecfee.ToString()  
  8.               + "','" + this.Workerdqfee.ToString()  
  9.               + "','" + this.Cjzpgdqfee.ToString()  
  10.               + "','" + this.Dxsgjxdqfee.ToString()  
  11.               + "','" + this.Debzglfee.ToString()  
  12.               + "','" + this.Jsqtzdkrate.ToString()  
  13.               + "','" + this.Gczljdfee.ToString()  
  14.               + "','" + this.Yuntufee.ToString()  
  15.               + "','" + this.Jfgzjgzfee.ToString()  
  16.               + "','" + this.Wsdyrfee.ToString()  
  17.               + "','" + this.Whclfee.ToString()  
  18.               + "','" + this.Bgyffee.ToString()  
  19.               + "','" + this.Yytfee.ToString()  
  20.               + "','" + this.Hlhtfee.ToString()  
  21.               + "','" + this.Jfxtfee.ToString()  
  22.               + "','" + this.Ybgjfee.ToString()  
  23.               + "','" + this.Gxzfzfee.ToString()  
  24.               + "','" + this.Lyglfee.ToString()  
  25.               + "','" + this.Jfzjfee.ToString()  
  26.               + "','" + this.Gdzjfee.ToString()  
  27.               + "','" + this.Gdlxlzjfee.ToString()  
  28.               + "','" + this.Workteamfee.ToString()  
  29.               + "','" + this.Condeptfee.ToString()  
  30.               + "','" + this.Tower.ToString()  
  31.               + "','" + this.Servicefee.ToString()  
  32.               + "','" + this.Checkfee.ToString()  
  33.               + "','" + this.Other.ToString()  
  34.               + "','" + this.ItemNum.ToString()  
  35.               + "','" + this.ItemName.ToString()  
  36.               + "','" + this.PassId.ToString()  
  37.               + "')"  
  38.               + " else update ProDesignSheet5 set Consplacepbfee='" + this.Consplacepbfee.ToString()  
  39.               + "',Searchtestfee='" + this.Searchtestfee.ToString()  
  40.               + "',Ccdesignfee='" + this.Ccdesignfee.ToString()  
  41.               + "',Propreparefee='" + this.Propreparefee.ToString()  
  42.               + "',Elecfee='" + this.Elecfee.ToString()  
  43.               + "',Workerdqfee='" + this.Workerdqfee.ToString()  
  44.               + "',Cjzpgdqfee='" + this.Cjzpgdqfee.ToString()  
  45.               + "',Dxsgjxdqfee='" + this.Dxsgjxdqfee.ToString()  
  46.               + "',Debzglfee='" + this.Debzglfee.ToString()  
  47.               + "',Jsqtzdkrate='" + this.Jsqtzdkrate.ToString()  
  48.               + "',Gczljdfee='" + this.Gczljdfee.ToString()  
  49.               + "',Yuntufee='" + this.Yuntufee.ToString()  
  50.               + "',Jfgzjgzfee='" + this.Jfgzjgzfee.ToString()  
  51.               + "',Wsdyrfee='" + this.Wsdyrfee.ToString()  
  52.               + "',Whclfee='" + this.Whclfee.ToString()  
  53.               + "',Bgyffee='" + this.Bgyffee.ToString()  
  54.               + "',Yytfee='" + this.Yytfee.ToString()  
  55.               + "',Hlhtfee='" + this.Hlhtfee.ToString()  
  56.               + "',Jfxtfee='" + this.Jfxtfee.ToString()  
  57.               + "',Ybgjfee='" + this.Ybgjfee.ToString()  
  58.               + "',Gxzfzfee='" + this.Gxzfzfee.ToString()  
  59.               + "',Lyglfee='" + this.Lyglfee.ToString()  
  60.               + "',Jfzjfee='" + this.Jfzjfee.ToString()  
  61.               + "',Gdzjfee='" + this.Gdzjfee.ToString()  
  62.               + "',Gdlxlzjfee='" + this.Gdlxlzjfee.ToString()  
  63.               + "',Workteamfee='" + this.Workteamfee.ToString()  
  64.               + "',Condeptfee='" + this.Condeptfee.ToString()  
  65.               + "',Tower='" + this.Tower.ToString()  
  66.               + "',Servicefee='" + this.Servicefee.ToString()  
  67.               + "',Checkfee='" + this.Checkfee.ToString()  
  68.               + "',Other='" + this.Other.ToString()  
  69.               //+ "',ItemNum='" + this.ItemNum.ToString()  
  70.               //+ "',ItemName='" + this.ItemName.ToString()  
  71.               //+ "',PassId='" + this.PassId.ToString()  
  72.               + "' where Sheet5id ='" + this.Sheet5id + "'";  
<
  以上是“SQL中if语句的用法示例[MSSQL防范]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
  • SQL中JOIN和UNION辨别、用法及示例介绍
  • 关于SQL中CTE(公用表表达式)(Common Table Expression)的总结
  • MySQL中CHAR和VARCHAR范例演变和详解
  • mysql中疾速插入百万条测试数据的办法
  • mysql中取字符串中的数字的语句
  • Mysql中校对集utf8_unicode_ci与utf8_general_ci的辨别阐明
  • mysql中RAND()随便查询记录效率问题和办理办法分享
  • mysql中字符串或字段中空格函数的删除
  • MySQL中关于varchar最大长度的问题
  • SQL中的CASE WHEN用法
  • sql中into的用法
  • 改正MySQL中一个用户的密码
  • 本文地址: 与您的QQ/BBS好友分享!
    • 好的评价 如果您觉得此文章好,就请您
        0%(0)
    • 差的评价 如果您觉得此文章差,就请您
        0%(0)

    文章评论评论内容只代表网友观点,与本站立场无关!

       评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
    Copyright © 2020-2022 www.xiamiku.com. All Rights Reserved .