Insert Trigger

  • Need a clarification on how insert trigger works in SQL Server.

    When i insert a record from VB, the insert trigger fires. But does the VB connection wait till the trigger completes.

    Paras Shah

    Paras Shah

    Evision Technologies

    Mumbai, India


    Paras Shah
    Evision Technologies
    Mumbai, India

  • Hi,

    I don't think the VB app "knows" anything about the trigger.

    This is SQL Server internal. So the connection will likely not wait till the trigger is finished. If you are running on errors, try to place a DoEvent statement in VB.

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Easy to test - just put a raiserror in the trigger, if VB receives the error message... Remember that the trigger is part of the transaction.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • Hi Andy,

    this assumes you're doing this within a transaction in vb, doesn't it?

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 4 posts - 1 through 4 (of 4 total)

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