当前位置: 代码迷 >> Sql Server >> C# 数据库插入数据解决方案
  详细解决方案

C# 数据库插入数据解决方案

热度:90   发布时间:2016-04-24 09:58:46.0
C# 数据库插入数据
例如:  
表名:table

name          ae           cs          fy           cl
裂缝             23           44        22.2        20
压裂             57           47        30.2        42

假如我现在要插入一条数据为:   压裂     57     47     30.2    42,这样的话,就有重复记录出现,怎么判断? 重复的话就覆灭,不重复的话就插入。

没有ID,所以不用回答什么判断ID。谢谢

insert   into  table  value(....).    条件如何写? 求大师帮忙!



------解决思路----------------------
直接在数据库里面判断也可以 
if not exists (select * from table  where name=‘压裂’ and ae=57 and 
cs=47 and fy=30.2 and cl=42)
insert into 
  相关解决方案