trigger is working for manual insert and not working for application isnerts

  • Hi ,

    trigger is working for manual inserts .. and

    not working as expected for application inserts .. please help

    when there is a row from application , 3 columns are copying to new table and forth column is showing as null.

    alter trigger copytable

    on dbo.maintable

    after insert

    as

    begin

    set nocount on

    declare @id nchar(32)

    declare @type nchar(10)

    select @id=(id) from inserted

    select @type=(type) from inserted

    if (@country='A)

    begin

    insert into dbo.w_table1 select * from inserted

    end

    else if (@type='B')

    begin

    insert into dbo.table2 select * from maintable where id=@id

    end

    end

  • What happens when you insert multiple rows? @id = ?? @type = ??

  • Hi Andrew,

    Thanks for your reply ..

    same behaviour for one /multiple inserts from application .

    - fourthcolumn(ntext) which contains chat history and this is encrypted before it loads into table ..

    trigger is unable to copy this data ..for appllication insert it shows as null.

    Thanks

    Suman

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply