Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sg2255551
Constraint Violating Yak Guru
274 Posts |
Posted - 2008-12-25 : 13:51:17
|
| hiI have a Stored Proc:Alter PROCEDURE spDelTradeNumber@TN as intASBEGINdeclare @Cnt as intSET NOCOUNT ON;Select @Cnt = Count(TN) from dbo.tblTradedetail where TN = @TNif @Cnt = 0begindelete from dbo.tblTradewhere TN = @TNendENDGOThis stored Proc is being called by an ASPNet page and i have a button that call this SP. however, it seems to be able to delete the TN even when there is a transaction at tblTradedetail.How do i solve this. Thanks and Merry Christmas |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
sg2255551
Constraint Violating Yak Guru
274 Posts |
Posted - 2008-12-26 : 04:29:48
|
| Thanks, i have forgotten all about foreign key constraint. Thanks so much |
 |
|
|
|
|
|