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 |
|
hesta96
Starting Member
9 Posts |
Posted - 2001-12-19 : 11:14:00
|
| HelloI hope you can help me with this because I am stuck!I have two databases for a publishing-system, one on the inside and one on the outside. When I write a publishing on the inside I use a trigger to also write it in the outside-database. But now I have entered a hard problem with this trigger. When I try it from the QueryAnalyser it works just fine but when I make a change from the webpage I get this errormessage:=========================================================Microsoft OLE DB Provider for SQL Server error '80040e14' [OLE/DB provider returned message: Cannot start more transactions on this session.] =========================================================The trigger is written like this:========================================================CREATE TRIGGER newsWWWContactUpdate ON ContactsFOR INSERT, UPDATE, DELETE ASDeclare @ContactID intIf exists (Select ID from Inserted)BeginSelect @ContactID = Cont.ID From Contacts as Cont Inner Join inserted AS Ins On Cont.ID = Ins.IDExec sp_newsWWWInsertContact @ContactID EndElse if exists (Select ID From Deleted)BeginSelect @ContactID = Cont.ID From Contacts as Cont Inner Join deleted AS del On Cont.ID = del.IDExec sp_NewsWWWDeleteContact @ContactIDEnd=============================================================And the SP that enters the data into the external DB is written like this:==============================================================CREATE PROCEDURE sp_newsWWWInsertContact@ContactID intASDeclare @ID intSelect @ID = IDFrom [nm-media].news.dbo.ContactsWhere ID = @ContactIDIf not @ID is NullBeginDelete From [nm-media].news.dbo.ContactsWhere ID = @IDEndInsert Into [nm-media].news.dbo.Contacts(ID,UnitID,Editorial_staff,Official_address,City,Visitor_address,Streetaddress,Boxnr,Postalcode,Tip_Phone,Phone,Fax,Email,Contact_orderby)Select ID,UnitID,Editorial_staff,Official_address,City,Visitor_address,Streetaddress,Boxnr,Postalcode,Tip_Phone,Phone,Fax,Email,Contact_orderbyFrom ContactsWhere ID = @ContactIDGO===========================================================I have no Ide'a what to do, I have tried with SET IMPLICIT_TRANSACTIONS But It does not work.Please help me!SincerelyHenrik StahleSveriges RadioSweden" |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2001-12-19 : 11:52:26
|
| Try SET XACT_ABORT ONHTH-Chad |
 |
|
|
hesta96
Starting Member
9 Posts |
Posted - 2001-12-20 : 03:46:12
|
Hello!Thanks!Sometimes it is so simple that you can't see it!It works alright!Marry Christmas!quote: Try SET XACT_ABORT ONHTH-Chad
|
 |
|
|
|
|
|
|
|