Results 1 to 1 of 1
  1. #1
    Join Date
    May 2004
    Posts
    1

    Unanswered: System.Data.SqlClient.SqlException: SqlDumpExceptionHandler: Process 52 generated fat

    Here is the error I get:
    System.Data.SqlClient.SqlException: SqlDumpExceptionHandler: Process 52 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION


    -------------------------------------------------
    I have the following trigger in sql server, and it compiles correctly. It seems to have problems when updating an ntext field with data from another table that is also an ntext field. Any help is appreciated.

    ---------------------------------------------------------------------
    --
    CREATE trigger TRG_SUPPORT_INCIDENTS_track_changes
    on dbo.SUPPORT_INCIDENTS
    instead of update as

    begin

    declare @incidentId varchar( 10 )
    declare @updatingUserKey int
    declare @shortDn nvarchar(255)
    declare @supportPriorityKey int
    declare @isLegacy bit

    -- Grab the values we can here and put them in local variables
    select
    @incidentId = si.incident_id
    ,@shortDn = si.short_dn
    ,@supportPriorityKey = si.support_priority_ky
    ,@isLegacy = si.is_legacy
    ,@updatingUserKey = si.engineer_user_ky
    from support_incidents si,
    inserted ins
    where si.incident_id = ins.incident_id


    begin transaction

    -- crete a new history item and get the new id
    insert support_incident_history
    (
    incident_id
    , history_type_cd
    , history_user_ky
    )
    values
    (
    @incidentId
    , dbo.HistoryTypeInternalNote()
    , @updatingUserKey
    )

    declare @historyId int
    select @historyId = scope_identity()

    -- create new note and get pointer to new text field

    insert support_incident_internal_notes
    (
    history_id
    , deleted
    , body_tx
    )
    values
    (
    @historyId
    , 0
    , 'Incident Updated\n<br/>----------------\n\n<br/><br/>'
    )


    DECLARE @ptrval binary(16)
    SELECT @ptrval = TEXTPTR( body_tx )
    FROM support_incident_internal_notes
    WHERE history_id = @historyId

    DECLARE @ptrval_long_dn binary(16)
    SELECT @ptrval_long_dn = TEXTPTR( long_dn )
    FROM support_incidents
    WHERE incident_id = @incidentId

    -- prepare to track changes

    declare @commit bit
    select @commit = 0

    declare @changedCount int
    declare @dataLength int


    -- long description
    select @changedCount = 0
    select @changedCount = count(*)
    from inserted ins inner join support_incidents si
    on ins.incident_id = si.incident_id
    where si. incident_id = @incidentId
    and si.long_dn not like ins.long_dn

    if @changedCount > 0
    begin
    select @commit = 1

    --select @dataLength = datalength( body_tx ) from support_incident_internal_notes where history_id = @historyId
    updatetext support_incident_internal_notes.body_tx @ptrval null 0 'Long Description\n<br/>-----------------'

    DECLARE @ptrval_long_dn_src binary(16)
    SELECT @ptrval_long_dn_src = TEXTPTR( long_dn )
    FROM deleted
    WHERE incident_id = @incidentId

    updatetext support_incident_internal_notes.body_tx @ptrval null 0 deleted.long_dn @ptrval_long_dn_src

    --need to perform the actual update
    updatetext support_incidents.long_dn @ptrval_long_dn null 0 deleted.long_dn @ptrval_long_dn_src


    end

    if @commit = 0
    begin
    rollback transaction
    end
    else
    begin
    commit transaction
    end

    end
    Last edited by jscherer; 05-20-04 at 17:36.

Posting Permissions

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