triggers

How to discover trigger's parent schema?

To discover all triggers in any given MS SQL Server database, I'm currently querying the sysobjects table (which is fine because it works in MS SQL Server 2000 which I have to support) e.g. SELECT R1.name AS trigger_name, T1.name AS trigger_parent_table_name FROM sysobjects AS R1 INNER join sysobjects AS T1 ...

Oracle Pl/SQL trigger compilation error via SQL*PLUS

I have a problem with compiling an Oracle trigger via SQL*PLUS - I don't think I'm being dumb but I can't see what the problem is. We have an installer script which is essentially a batch file which creates/refreshes all the objects in the database by calling SQLPLUS on multiple scripts, each containing one view, trigger, etc. The table...

WPF - How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question: How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I'm after: when an item appears in my ListBox, it should flash for a few moments if the item is 'Critical' then it should remain highlighted Currently I have a DataTemplate t...

SQL Server triggers

I'm creating a trigger in SQL Server after INSERT, UPDATE and DELETE. Is there a way to know inside the trigger code if it is running on the insert update or delete statement, because I need different behaviors on each case, or I need to create a trigger for each one of them. Thanks in advance, Paulo ...

Serializing DB/2 Triggers

We have a requirement to process transactions as an ordered sequence. Transactions are initiated on system 'A' and written to a DB/2 table. A DB/2 trigger then forwards the transaction via MQSeries to system 'B' where the transaction is completed. The problem we are having is that a race condition is established because execution of the...

monitoring mysql for changes

I have a Java app using a MySQL database through hibernate. The database is really used as persistence layer: The database is read at the initial load of the program, and the records are then maintained in memory. However, we are adding extra complexity, where another process may change the database as well, and it would be nice for t...

Error when triggering a build through the TFS API 2010 Beta 2

Hi I am trying to trigger a build through the TFS API. First, I select the necessary changesets I want, then create a label for them, and then execute a selective build of these changesets. I get the following error message : TFB210503: An error occurred while initializing a build for build definition \Test\Label Changesets: TF14064: C...

sql server execute as permission errors in trigger

I have a trigger where I want to send out an email on updates to a row in a table SalesClosing. Now the user (dbuser) who execute the trigger has very limited permissions. So I want the trigger to execute as dbmailuser. A user who has rights to send out email. I tested that dbmailuser can execute sp_send_dbmail when logged in as that use...

SQL Server: Can I set a trigger on ALTERing a stored proc?

Everytime a stored proc is ALTERed or CREATEd, I want to capture that in a trigger to do some stuff afterwards. Can I do that in SQL Server 2008? Thank you. --Beemer ...

Jquery mouseover/mouseout triggering inconsistently

I have two sortable lists, one being nested, with a mouse over effect on the li elements of the nested sortable list. My problem is that the mouseover and mouseout functions are being called inconsistently when a user moves the mouse quickly through the list over the child elements. Here is a sample of what is happening, you have to dr...

Create a before delete trigger?

id country_name region area population 1 LASvega Americas 2314 2134562 2 California AMERICAS 10101 2134562 3 Algeria Middle East 24000000 32900000 4 Andorra Europe 468 64000 fire a delete query , just before that this trigger is fired an...

SQL Server: pause a trigger

I am working with SQL Server 2005 and I have trigger on a table that will copy an deletions into another table. I cannot remove this trigger completely. My problem is that we have now developed an archiving strategy for this table. I need a way of "pausing" a trigger when the stored proc that does the archiving runs. ...

wpf trigger to change parent property

i want to override element triggers so when clicking on a textbox to change property of the parent border. however i get that the parent targetname is not recognized. please help. code sample is this: <Style x:Key="customstyle" TargetType="{x:Type local:customcontrol}"> <Setter Property="Background" Value="{StaticResource DownGradie...

Before trigger in SQL Server

I have 2 tables: survey (id(PK), name) and survey_to_topic (survey_id(PK,FK,not null), topic_id(PK,FK,not null)). When I try to delete from survey table, I get exception: "The DELETE statement conflicted with the REFERENCE constraint "FK_survey _to _topic _survey". The conflict occurred in database "mydatabase", table "dbo...

problem with mutating tables

I want to create trigger which will be fired after insert into some table, let`s say user. In this trigger I want to select some records from table user, besides this one I insert to table, but then I receive error about mutating table. Is it possible to get records from this table? ...

Help with insert trigger

hey i have a temp table (question_desc, ans1, ans2, ans3, ans4, correct_ans, marks) with say 10 entries from this table i have to insert values in two other tables questions (q_id(auto-generated), que_desc, marks) answers (ans_id(auto_generated), q_id(FK), ans_desc, istrue) for each insert in question table there should be four inse...

How can I replicate a table from SQL 2000 to SQL 2008?

I have a table on a SQL Server 2000 database, which I want copied verbatim to a 2008 server. I tried to do it manually with INSERT/UPDATE triggers, but this technique runs in a distributed transaction, which does not work because I apparently have to enable MSDTC and the firewall; I don't want to do any of that. Are there any other way...

creation of trigger

I have this trigger procedure CASE_A as UPDATE table1 SET field1 = (SELECT bus FROM view1 WHERE table1.document = view1.document) end; the below trigger is supposed to execute the above procedure CASE_A (Case_A is supposed to put a value into field1) CREATE OR REPLACE TRIGGER "CASE_A" AFTER INSERT ON "TABLE1" FOR EACH R...

Performance impact - varbinary(max) and triggers

I was reading other post related to a problem I'm facing (http://stackoverflow.com/questions/1477690/what-is-the-benefit-of-having-varbinary-field-in-a-separate-1-1-table) looking for an aswer but I cant find one since a have a different scenario. I've read splitting varbinary(max) data into another table would no get performance improv...

Mysql trigger/events vs Cronjob

Hello, I have an auction website which let my users place an unlimited amount of autobiddings. To monitor these autobiddings something has to check the database every second. My question is if it is better to use mysql trigger events or to user a cronjob every minute that executes a 60 sec looping php script. If i use the mysql tr...