批量删除记录的存储过程写法?
在程序里面用了个全选按钮,循环遍历把要删除的记录编号拼接在一起(不想遍历一个删除一个,那样效率太低了),准备把这个字符串当成一个参数传到存储过程里面,请教怎么写这个存储过程才能删除这些记录?
------解决方案--------------------将编号已“,”号分割作为存储过程的参数传进去 
 然后使用自带的函数写个象ASP中的SPLIT函数的用法 
 应该可以
------解决方案--------------------create table T(id int) 
 insert T select 1 
 union all select 2 
 union all select 3 
 union all select 4 
 union all select 5   
 create proc pc(@id varchar(20)) 
 as 
 exec( 'delete T where id in( '+@id+ ') ') 
 go     
 exec pc  '2,3 '   
 select * from T   
 --result 
 id           
 -----------  
 1 
 4 
 5   
 (3 row(s) affected)