Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Pittsburgh, PA

    Question Unanswered: Trigger Error when App runs

    I have SQL Server 2000, and our web application is in WebObjects.

    I built a trigger on a table that indicates if certain fields in a record have been changed since the last time a report was run from the application.

    This trigger runs fine through the Query Analyzer, and runs fine with a direct input through enterprise manager. However, when the WebObjects application tries to update the table, and error is thrown.

    Is anyone familiar with a reason why an application would throw an error on an update, when the DB tools do not? If we disable the trigger, the application has no problem updating the table.

    Here is the relevant portion of the trigger:

    create trigger t_press_run_change
    on dbo.press_run_line_item
    for insert, update, delete

    update press_run_line_item
    set is_changed = 1
    from deleted d
    join press_run_line_item p on p.press_run_line_item_id = d.press_run_line_item_id
    where (p.is_changed = 0 or p.is_changed is null)
    AND ( (isNull(p.print_quantity,0) <> isNull(d.print_quantity,0))
    OR (isNull(p.spoilage_pct,0) <> isNull(d.spoilage_pct,0))
    OR (isNull(p.ad_dimension_id,0) <> isNull(d.ad_dimension_id,0))
    OR (isNull(p.quarter_fold_id,0) <> isNull(d.quarter_fold_id,0))
    OR (isNull(p.max_qty_per_shipment,'') <> isNULL(d.max_qty_per_shipment,''))
    OR (isNull(p.packaging_max_height,'') <> isNull(d.packaging_max_height,''))
    OR (isNull(p.packaging_max_weight,'') <> isNull(d.packaging_max_weight,''))
    OR (isNull(p.packaging_skids,'') <> isNull(d.packaging_skids,''))
    OR (isNull(p.packaging_turns,'') <> isNull(d.packaging_turns,''))
    OR (isNull(p.packaging_cartons,'') <> isNull(d.packaging_cartons,''))
    OR (isNull(p.preprint_delivery_time,'') <> isNull(d.preprint_delivery_time,''))
    OR (isNull(p.contact_id,0)<> isNull(d.contact_id,0))
    OR (isNull(p.address_company,'')<>isNull(d.address_co mpany,''))
    OR (isNull(p.address1,'')<>IsNull(d.address1,''))
    OR (isNull(p.address2,'')<>IsNull(d.address2,''))
    OR (isNull(p.address_city,'')<>IsNull(d.address_city, ''))
    OR (isNull(p.address_state,'')<>IsNull(d.address_stat e,''))
    OR (IsNull(p.address_zip,'')<>IsNull(d.address_zip,'' ))
    OR (isNull(p.address_Country_id,'')<>IsNull(d.address _country_id,''))
    OR (isNull(p.client_printer_id,'')<>IsNull(d.client_p rinter_id,'')))

  2. #2
    Join Date
    Sep 2005
    What's the error message?

  3. #3
    Join Date
    Jun 2003
    Provided Answers: 1
    From looking at the code, I'm guessing a time-out error.
    If it's not practically useful, then it's practically useless.

    blindman "sqlblindman"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts