这很奇怪,但我的SQL Server不会删除项目:
我有一个这样的存储过程:
Create Procedure DeleteItem @cnm nchar(10)
as
Begin Transaction
Delete From T1 where Cnm = @cnm
Delete From T2 where Cnm = @cnm
if @@ERROR <> 0
Begin
Commit
End
Else
Begin
RollBack
End
当我在SQL Server Management Studio中运行此查询时:
Exec DeleteItem '1111111111'
它在Messages
窗格中返回:
(1 row(s) affected)
(1 row(s) affected)
但是当我从那些表中获取数据时,删除的记录仍然存在!
我做错了吗?