我有一张表,编号设为主键,并且是自增长的,然后这张表还有其他字段,工作卡号,姓名,公司系统帐号,密码。现在我有两条数据,工作卡号,姓名,公司系统帐号,密码都一样,就只有编号不同,有人离职,需要删除其中一条数据,为什么我删除的都会是两条同时删除,BLL层的代码是这样:
public void delete(string Card_ID)
{
string strDel = string.Format("insert into DelSystemTable(ID,Card_ID,UserID,Name,PassWord,CreatTime,SystemName,DeleteTime)select ID, Card_ID,UserID,Name,PassWord,CreatTime,SystemName,getdate() from SystemTable where Card_ID='{0}' delete SystemTable where Card_ID='{0}'", Card_ID);
sqlH.ExSql(strDel);
}