Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2009
    Posts
    12

    Unanswered:

    It is working fine from query analyzer and does return the currct result.

    I am using trigger to generate customized integer-based GUID.

  2. #2
    Join Date
    Aug 2009
    Posts
    12

    Capture Result Set From Trigger

    Hi,

    I am having difficulty to capture result set from trigger to client application. Can anybody help me out?

    Thanks in advance!

    Tina

  3. #3
    Join Date
    Jun 2009
    Location
    CA, USA
    Posts
    59
    What exactly you are trying to do with trigger result set?

    You can use the trigger tables...
    Inserted and deleted tables...check BOL...

    CREATE TRIGGER

    deleted and inserted are logical (conceptual) tables. They are structurally similar to the table on which the trigger is defined, that is, the table on which the user action is attempted, and hold the old values or new values of the rows that may be changed by the user action. For example, to retrieve all values in the deleted table, use:
    SELECT *
    FROM deleted
    In a DELETE, INSERT, or UPDATE trigger, SQL Server does not allow text, ntext, or image column references in the inserted and deleted tables if the compatibility level is equal to 70. The text, ntext, and image values in the inserted and deleted tables cannot be accessed. To retrieve the new value in either an INSERT or UPDATE trigger, join the inserted table with the original update table. When the compatibility level is 65 or lower, null values are returned for inserted or deleted text, ntext, or image columns that allow null values; zero-length strings are returned if the columns are not nullable.
    If the compatibility level is 80 or higher, SQL Server allows the update of text, ntext, or image columns through the INSTEAD OF trigger on tables or views.
    MohammedU
    SQL Server MVP

  4. #4
    Join Date
    Aug 2009
    Posts
    12
    Unfortunately, the result set from trigger is not either in inserted nor in deleted. Any idea?

    Thanks again!
    Tina

  5. #5
    Join Date
    Jun 2009
    Location
    CA, USA
    Posts
    59
    That means trigger is not fired.
    Are you sure trigger is enabled?
    MohammedU
    SQL Server MVP

  6. #6
    Join Date
    Aug 2009
    Posts
    12
    The trigger was really fired.

    I was modifying one of inserted values. I want to return modified value from trigger to client application.

  7. #7
    Join Date
    Jan 2003
    Location
    British Columbia
    Posts
    44
    Note that the ability to return results from a Trigger has been deprecated in SQL 2008 and won't be supported in future versions. Also the server option "disallow results from triggers" is on by default (in 2005, off is the default).

    Are you getting errors? VB6, .NET?? Post some code

Posting Permissions

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