我现在得到一个存 id的数组long[] id,怎样才能删除数组中所有的id的记录呢?
delete from TABLE where 后面该怎么写呢?
很急,需要你的帮助

解决方案 »

  1.   

    delete from tbName where id in()
      

  2.   

    把数组构造成字符串,然后写
    delete from table where charindex(id,字符串)>0
      

  3.   

    delete from tbName where id in(1,2,3,4,...)在前台拼SQL語句
      

  4.   

    我这个数组的长度是不固定的,也就是说每次删除的时候可能删除的记录数目不一样
    delete from TABLE where in("&Ary(0)&","&Ary(1)&","&Ary(2)&","&Ary(3)&","&Ary(4)&","&Ary(5)&")" 
    我现在这个Ary(i)该怎么写呢
      

  5.   

    string V_ids = "-1";
    foreach(int i in Ary)
    {
       V_ids += "," + i.ToString();
    }
    string V_sql = "delete tbName where id in(" + V_ids + ")";C#的代碼, 僅供參考
      

  6.   

    chenyubo83() ( ) 信誉:100    Blog  2006-12-22 11:07:17  得分: 0  
     
     
       菜鸟问题"那两个加号是什么意思
      
     
    ----------
    哪兩個加號?
      

  7.   

    + V_ids +是连接的意思吗