5

I have a database in MS SQL Server 2008 that has 3 tables. I want to create a trigger for INSERT, UPDATE and DELETE for each row for these tables. For the trigger function I want to call a python function. The python script needs to write some of the columns from the row for which the trigger occurred and write it to a socket. I checked on the net but could not find how the python function can be called as a trigger function.

Edit: Or is there a way the trigger procedure in SQL can do this itself? Can it act as a TCP server and write the trigger data to the socket?

1 Answer 1

4

As explained here you can attach some .NET methods in SQL triggers, and then use IronPython to code your trigger, but it will cost you in term of security and performance.

You can also use Database Email which is able to send an email which the content of what you need to catch, and grab it elsewhere in your own mail server.

Sign up to request clarification or add additional context in comments.

1 Comment

Is there a way the trigger function itself can do this? Can it work like a TCP server and keep posting the trigger data to the socket?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.