triggers

MySQL After Insert and After Update Trigger

Hi! I have two tables t1 and t2. i have created two triggers tr1 after insert on t1 and tr2 after update on t2. in both the tables i m updating table t2. so, it is throwing an error saying the t2 table is already getting updated in another trigger so can not update it again. Please let me know if anyone has faced this type of problem a...

SQL Server 2005 Delete Trigger select from deleted returns null

I have a table called hl7_lock in SQL Server with these columns: hl7_id lock_dtm lock_user I have 3 triggers on the table for UPDATE, INSERT, and DELETE The table is never updated, but INSERT trigger is working perfectly. However this delete trigger occasionally puts a record in hl7_lock_log with a null hl7_id SET NOCOUNT ON; de...

Oracle triggers error are not captured while using ADODB

I have and application which uses Adodb to insert data in Oracle table(customers database). Data is successfully inserted if there are no errors. If there is any error like invalid datatype etc. Error is raised and captured by my application and dumped in log gile. My customer has written their own triggers on this particular table. Wh...

Select All Checkbox in XAML using trigger?

Hi. I'd like to implement a select all checkbox in xaml. I have several (templated) checkboxes in a listview. Then I have a checkbox outside of the listview, which I want to have a "select all"-behaviour. I could easily solve the problem in my ViewModel, however, I think it would be more elegant to do this in xaml, since the select all ...

Avoid hardcoding when changing values in SQL Server trigger

I have a sql server "instead of insert" trigger that populates a single column (PromoCode). It all works perfectly, but I don't like the fact I have had to hardcode the columns in actual INSERT statement: CREATE TRIGGER PopulateOrderPromoCode ON Order INSTEAD OF INSERT AS BEGIN --// Get the Promo Code DECLARE @PromoCode int; ...

Excel triggered macro

I am struggling to carry out the following. Any help would be greatly appreciated. The marco only relates to one excel worksheet. I have 50 rows of information, 11 columns wide (A - K) in each row of column A there sits an IF condition If the IF condition flags the word 'OK' I would like a macro to trigger, and carry out the followin...

MySQL Trigger based Audit logging with comparisons

In looking at similar questions like: http://stackoverflow.com/questions/740182/getting-trigger-to-insert-changed-column-values-only-in-audit-table http://stackoverflow.com/questions/617225/audit-logging-strategies I would like to take this one step further and compare the updated data to see if it actually has been updated... I'm not...

MySQL: Initialize a summary table with placeholders for non-existent data

I'll try to give this as generically as I can so it's reusable. I am running a site with a fairly large MySQL database which has grown to need some summary/rollup tables initialized. For the example's sake, let's say it's soccer statistics. Since I handle multiple soccer leagues in the same database, many of them play games of differe...

Isolating triggers from WPF THemes

HI, I am using the WPF themes libary which is relaesed in Codeplex.com. All works fine. The theme used is applied. But there is a problem when I need to create a style for a button control(With triggers especially) and associate it with a button. What happens is the theme does not get applied to that button alone because I have a differ...

TSQL: Try-Catch Transaction in Trigger

I am trying to put a try-catch statement inside a trigger using Microsoft Server 2005. BEGIN TRANSACTION BEGIN TRY --Some More SQL COMMIT TRANSACTION END TRY BEGIN CATCH IF (XACT_STATE()) = -1 BEGIN ROLLBACK TRANSACTION; END; END CATCH The problem is that I don't want the trigger to fail if something is caught by the try-catch ...

WPF ComboBox - showing something different when no items are bound

I have a ComboBox, and i want to change its look when the ItemsSource property is null. When it is in that state, i want to show a TextPanel with the text "Retrieving data" in it, and give it a look kind of similar to the watermarked textbox. I figure to do this i need a ControlTemplate, and a trigger. I have the ControlTemplate here: ...

Ensuring correct data in MS SQL Server, DB Level

Hey Stackoverflow. Say I have a table with the following layout: Id Int PRIMARY KEY IDENTITY DateFrom datetime NOT NULL DateTo datetime NOT NULL UserId Int UserId is a foreign key to a users table, and well obviously there's more data which is irrelevant to this question. What I want to do, is to make sure that per User, there can ...

What is the difference between the two sql statements?

Good Day All we are trying to do is inside a trigger make sure the user is not inserting two fees that have 'alone' in the name. Those fees need to be handled individually. For some reason, it appears the top section of sql quit working two weeks ago. To get around it I recoded it the second way and get the correct results. What I...

Trigger that modifies multiple rows on diffrent table then it was invoked on in SQL Server 2005

I have tried to perform update on table which was trigger by update on other table and I got error message: The row value(s) updated or deleted either do not make the row unique or they alter multiple rows. For example I have this tables: table_1 =========== int id (primary_key,identity) nchar(10) state_name table_2 =========== in...

Trigger change event of dropdown

I want to trigger the change event of dropdown in $(document).ready using jquery. I have a cascading dropdown for country and state in user details page. how can i set the value (which is taken from DB based on the user id) for country and state in MVC with C#. ...

What are good Linux tool(s) for MySQL administration and profiling?

While Windows releases of MySQL administration and profiling tools seem to be a dime a dozen, I'm having a very hard time finding very many designed for Linux. Note that I'm not looking for monitoring software ala Nagios/Munin here. This would be something more along the lines of a SQLYog. While I could write some basic scripts to han...

Creating a trigger dynamic

I use MS SQL 2008 and I want to create a trigger in a database that is created dynamic. Creating the database is called within a stored procedure of an other database and runs perfectly, but when I want to add a trigger or a stored procedure, the executing fails. If I try to run the dynamiy SQL with an EXEC('USE dbase GO CREATE TRIGGE...

In XAML, how can I keep an ellipse being a circle?

I'm getting XAML-blind I'm afraid. I'm developing a MS Surface application and I have an ellipse inside a ScatterViewItem (a container an end user can resize). I would like to keep the ellipse a circle (width == height) and keep it as big as possible (the lowest value of width/height of the SVI should be taken for both width/height prope...

Oracle: Using subquery in a trigger

How can I work around the Oracle's limitation of not allowing subqueries in triggers. Here's an example trigger I'm trying to create, but am unable to because I can't use a subquery. CREATE OR REPLACE TRIGGER trigger_w_subquery AFTER UPDATE OR INSERT ON project_archiving FOR EACH ROW WHEN (old.archiving_status <> new.archiving_status ...

Trigger that inserts into linked table causing an error

I'm having an issue with a trigger that inserts a value into the same tabled on a linked server. Here is the trigger in question ... USE [localDB] GO /****** Object: Trigger [dbo].[INS_New_Row] Script Date: 05/26/2009 10:50:56 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -...