dbTalk Databases Forums  

Trigger: To fill another Database with using Stored Procedures of the other Database

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Trigger: To fill another Database with using Stored Procedures of the other Database in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pascal.baetscher@gmail.com
 
Posts: n/a

Default Trigger: To fill another Database with using Stored Procedures of the other Database - 04-24-2007 , 09:15 AM






Hello everyone,

I face currently a problem where I could need some input for searching
the source of the Problem

System: SQL Server 9.0

I fill from Database A with triggers Database B, everything works
fine.
On Database B there is a Stored Procedures that checks the records and
add additional information accordingly, this Stored Procedures is
normally called by the application on "update and insert" in the
according table.

When I try to call this Stored Procedures from the Database A, the
trigger does not work anymore, even if I do a try catch over the whole
trigger, he never reach the Catch and the insert I try to do there to
get the error message.

On both Databases the user, that is taken to execute the trigger is
existent and DB-Owner of both Databases.

If I go and execute the Stored Procedures manually after an insert or
update to Database B everything works fine.

I also already tried to check on Database B if there is an insert or
update from Database A and if, to execute the Stored Procedures, with
the same result, nothing and all happens anymore, neither update on
Database A and also not on Database B.
And also I cant catch the error as the Try/Catch is not working.

Hope I could explain it understandable and maybe someone remembers
already having the same problem.

Thanks & Best regards
Pascal


Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Trigger: To fill another Database with using Stored Procedures of the other Database - 04-24-2007 , 05:30 PM






(pascal.baetscher (AT) gmail (DOT) com) writes:
Quote:
I face currently a problem where I could need some input for searching
the source of the Problem

System: SQL Server 9.0

I fill from Database A with triggers Database B, everything works
fine.
On Database B there is a Stored Procedures that checks the records and
add additional information accordingly, this Stored Procedures is
normally called by the application on "update and insert" in the
according table.

When I try to call this Stored Procedures from the Database A, the
trigger does not work anymore, even if I do a try catch over the whole
trigger, he never reach the Catch and the insert I try to do there to
get the error message.
So there is a an error message? What about posting it?

Overall, if it's possible, I would appreciate if you could post the
code of the stored procedure and the trigger, because I have some
problems following your narrative what is happening.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #3  
Old   
Dashu
 
Posts: n/a

Default Re: Trigger: To fill another Database with using Stored Procedures of the other Database - 04-27-2007 , 08:39 AM



Hello,

Thanks for your answer and I just noticed that I double posted this
message.

First I was not able to catch the errormessage, I started the triggers
over the application and in the expected return value was nothing,
after change the Trigger and lunch with the console, i had the
following error:
Msg 3616, Level 16, State 1
Transaction doomed in trigger. Batch has been aborted.

I already found the problem and was able to solve it, sorry for the
late reply.

And thanks for the input, next time I'll extract necessary parts of
the triggers.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.