Board index » delphi » The rollback transaction request has no corresponding BEGIN TRANSACTION

The rollback transaction request has no corresponding BEGIN TRANSACTION

I have made a trigger on MSSQL server, which checks if a record being
deleted has dependent (detail) records. If this is the case it reports
an error message with nuber 3003  and error message in Slovene
language.. Instead of this user defined error message my application
gets esception with message "The rollback transaction request has no
corresponding  BEGIN TRANSACTION". Why?

How can I send user defined messages from triggers to client
applications?

 

Re:The rollback transaction request has no corresponding BEGIN TRANSACTION


Branko -

Quote
>I have made a trigger on MSSQL server, which checks if a record being
>deleted has dependent (detail) records. If this is the case it reports
>an error message with nuber 3003  and error message in Slovene
>language.. Instead of this user defined error message my application
>gets esception with message "The rollback transaction request has no
>corresponding  BEGIN TRANSACTION". Why?

>How can I send user defined messages from triggers to client
>applications?

Can you post the code for your trigger?

--
Clayton Neff
Software Project Leader
The Personal Marketing Company, Inc.
11843 West 83rd Terrace
Lenexa, KS  66214
(913)492-0322
clay...@tpmco.com

Re:The rollback transaction request has no corresponding BEGIN TRANSACTION


I have found the solution.

On Fri, 10 Apr 1998 06:01:24 GMT, branko.starasi...@danfoss-cmpr.si

Quote
(Branko Starasinic) wrote:
>Here is a part of trigger that checks if "Merilo" has children in
>"Pripomba". Table pripomba is a table with comments. I has 5 fields:

>Ime_tabele <= the name of the table to wich this comment belongs
>Stevilka      <= numer of artikel, invoice, ... to which tis comment
>belongs
>Stevilka_vrstice <= the serial number of record

>datum <= in this field users can insert the date of comment or any
>other date

>Pripomba <= this is a field where user can put a comment

>Here is the part with which I have problems.

>    /*  Cannot delete parent "Merilo" if children still exists in
>"Pripomba"  */
>    if exists (select 1
>               from   Pripombe t2, deleted t1
>               where  ('Merilo' = t2.Ime_tabele) and
>                      (t2.Stevilka =
>Convert(char(20),t1.stevilka_merila)))
>       begin
>          select @errno  = 30006,
>                 @errmsg = 'Za to merilo ?e obstajajo pripombe. Ne
>morem brisati merila.'
>       raiserror @errno @errmsg

The next line must not exist.

- Show quoted text -

Quote
>       rollback  transaction

>       end

>On 9 Apr 1998 11:57:01 -0700, cn...@primenet.com (Clayton Neff) wrote:

>>Branko -

>>>I have made a trigger on MSSQL server, which checks if a record being
>>>deleted has dependent (detail) records. If this is the case it reports
>>>an error message with nuber 3003  and error message in Slovene
>>>language.. Instead of this user defined error message my application
>>>gets esception with message "The rollback transaction request has no
>>>corresponding  BEGIN TRANSACTION". Why?

>>>How can I send user defined messages from triggers to client
>>>applications?

>>Can you post the code for your trigger?

>>--
>>Clayton Neff
>>Software Project Leader
>>The Personal Marketing Company, Inc.
>>11843 West 83rd Terrace
>>Lenexa, KS  66214
>>(913)492-0322
>>clay...@tpmco.com

Other Threads