Re: How can i call a Trigger in ASP.NET ?

From: Shan Plourde (------_at_---.net)
Date: 07/28/04


Date: Wed, 28 Jul 2004 12:31:31 GMT

Triggers are not like stored procedures or functions. Normally you can
decompose your trigger logic into 2 items, 1 being the trigger, the
other being a stored procedure that the trigger can then call. This way,
you can also call the stored procedure from ASP.NET.

If that is not possible, a kludge is to issue a SQL statement that will
fire the trigger. For example, if you have an update trigger on column
XYZ, then if you issue an UPDATE table SET XYZ = XYZ (dummy SQL
statement to force trigger fire), that should do it, but I wouldn't
recommend it over the first option.
Shan

Ricardo Corsi wrote:

>Hi,
>
>It is possible to call a trigger (inside a sql server..) with asp.net ? how
>can i do that ?
>thks!
>
>
>
>



Relevant Pages

  • Re: chooses not to generate code at all
    ... >>>DBMS is so that the DBMS engine can execute it when triggered by some ... If there is no trigger, ... Stored procedure is one thing. ... > If the procedure execution is not triggered by DBMS ...
    (comp.object)
  • Re: Insert Error 30014
    ... of @@identity before the stored procedure finish: ... the trigger. ... I have a form where I want to have underlying record source of a single ... EventId ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Insert Error 30014
    ... of @@identity before the stored procedure finish: ... the trigger. ... >> I have a form where I want to have underlying record source of a>> single ... >> EventId ...
    (microsoft.public.access.adp.sqlserver)
  • RE: How do I schedule transactions in SQL Server?
    ... The database will consist of a Master table of the payments ... Service which will call a stored procedure in SQL (which ... the trigger will kick in when ever the master table above is modified (or a ... > Database Administrator ...
    (microsoft.public.sqlserver.server)
  • A few T-SQL questions...
    ... I have a few T-SQL questions that i'm hoping someone can answer for me. ... trips (i'm not using a stored procedure for this for several reasons). ... What's the best way to write an update statement so that only fields ... I have a table that has a trigger that does ...
    (microsoft.public.sqlserver)