一次删除数据库中的多个记录 [英] Deleting multiple records in database at once

查看:110
本文介绍了一次删除数据库中的多个记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



请帮帮我,如何用cml中的xml作为输入参数删除数据库中的多条记录。



我只需要在sql server 2005中存储过程。



请帮助我,非常紧急。





问候

Nagaraj.J

Hello,

Please help me, How to delete multiple records in database with xml as input parameter in c#.

I just need the stored procedure in sql server 2005.

Please help me, its very urgent.


Regards
Nagaraj.J

推荐答案

参见

收集数据串中的数据

string IDs =1,5,7



将此ID传递给storeprocedure作为参数



并写一个像

See
Collect you data in a string lit
string IDs="1,5,7"

Pass this IDs to your storeprocedure as a parameter

And write a query like
Delete from your table_name where ID in (@IDs)





查看此问题讨论的链接



http://forums.asp.net/t/1859005.aspx?Delete +多个+记录+使用+ SQL +删除+查询 [ ^ ]


这篇关于一次删除数据库中的多个记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆