transactions and triggers

  • Hello,

  • Sorry, newbie who fatfingered his first entry. I have a requirement to send a notification to a 3rd party application when data is inserted into a table in my database. My experience is limited to transact-sql for programmability, so I don't have access to any other programming language. I am using the insert trigger to wrap up the required data in xml format to send to the other application, but I am getting the error ‘cannot start a transaction’ error when the trigger fires. This is because the 3rd party database is not allowing external sources to start a transaction via the DTC. Is there any way to get a trigger to fire without a transaction?

    Any help would be appreciated.

  • I don't know of a T-SQL way to do that precisely.

    This might be something a CLR could do without a transaction. You'd need to get help writing it, but it might work.

    I'm assuming the option of having the database send an e-mail wouldn't accomplish what you need. (SQL 2005 can do that straight from T-SQL, if you set up the server to do that.)

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • As an aside, there are Edit and Delete buttons on your posts that you can use. You should be able to delete the empty post and then edit the follow-up post so it doesn't reference that.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • You cannot within a trigger, but you are describing a scenario that Service Broker is pretty well designed to handle. You may want to read up on it.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply