日期:2014-05-18  浏览次数:20355 次

求一个删除多条数据的存储过程?
求一个删除多条数据的存储过程? 根据ID删除

------解决方案--------------------
SQL code

create procedure a as
delete from tb where id=?

execute a

------解决方案--------------------
SQL code
Create proc Del_P (
@ID int
)
SET XACT_ABORT on ;
begin tran
delete table1 where ID=@ID
delete table2 where ID=@ID

commit tran

go
或用 
begin try
begin tran

...
commit tran
end try
begin catch
select ERROR_MESSAGE()
rollback tran
end catch