Thanks to all for your instruction, insights and cautions.
If I do use TRIGGERS I will do as Emmit illustrated,
and drop the trigger after the one routine that needed it.
Sincerely,
Sharon


----- Original Message ----- From: "Albert Berry" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, October 29, 2004 11:46 AM
Subject: [RBG7-L] - Re: Triggers



I have one caution concerning triggers. Triggers slow things down. This is nothing to do with
R:Base; triggers have to be used sparingly in SQL Server because of the performance hit. Insert
and Delete triggers are not as intrusive as an UPDATE trigger, which can fire each and every time
a user closes a row of data, depending on what the trigger checks for. If you think of this
procedure firing every time a user moves down a row in a DBGrid or scrolling region, you will have
a better idea of the hit that might result.


My Cdn $0.01 worth. And it's worth more every day!

--- Emmitt Dove <[EMAIL PROTECTED]> wrote:


Sharon,

Here is an example that drops the trigger, loads the procedure and creates
an after insert trigger:


   ALTER TABLE rfxrhr DROP TRIGGER INSERT
   DROP PROCEDURE rfxrhr
   PUT rfxrhr.prc AS rfxrhr RETURN INTEGER +
       comment 'RF Release Roll from Hold Insert Trigger'
   ALTER TABLE rfxrhr ADD triggers INSERT after rfxrhr

>Hi All,
>
>Great conference with lots of gems!
>Unrelated to any of those topics, I am working on something most of you
>learned long ago.
>
>I am trying to use Stored Procedures and Triggers for the first time. I
>successfully created the Stored Procedure and can run it using the CALL
>command.
>
>Now, what I want to do is to Trigger the Procedure as an AFTER INSERT.
>If I understand the documentation correctly, a Trigger runs the >Procedure
>BEFORE the row is inserted, updated or deleted.
>But, I thought I remembered hearing about AFTER INSERT Triggers at an >RBTI
>Conference in the past.
>
>Also, how do I put the Trigger in place?
>
>What I am trying to do is to enter data for a new row into a form and >then
>as the form is refreshed using an ADD Row button, I want to print a >report
>based on the previously entered row.
>Alternately, I would like to have a button on the form that would print
>data from the screen right to a report.
>I don't know how to do this since the data has not been added to table >yet.
>
>Thanks for any help.
>Sharon Lima


Emmitt Dove
Manager, DairyPak Business Systems
Blue Ridge Paper Products, Inc.
40 Lindeman Drive
Trumbull, CT  06611
(203) 673-2231
[EMAIL PROTECTED]
[EMAIL PROTECTED]



=====
Albert Berry
Management Consultant
RR2 - 1252 Ponderosa Drive
Sparwood BC, V0B 2G2
Canada
(250) 425-5806
(250) 425-7259
(708) 575-3952 (fax)
[EMAIL PROTECTED]

--- RBG7-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [EMAIL PROTECTED]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE:
Send a plain text email to [EMAIL PROTECTED]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [EMAIL PROTECTED]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
================================================




Reply via email to