Results 1 to 5 of 5

Thread: SQL Express, Connections and triggers

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    SQL Express, Connections and triggers

    Hi All,

    Can someone tell me if when a trigger is fired does it consume a connection and how does this effect performance ?


    Thanks In Advance

    Parksie

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: SQL Express, Connections and triggers

    no... it runs completely on the server, within the current connection. As for performance... depends on what the trigger does.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Re: SQL Express, Connections and triggers

    So what you are saying is that if sql only supports 1 connection and I update a table which in turn fires off 3 triggers the triggers will not require that 1 connection but will do all the work internally without any concept of the connection object.

    Parksie

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: SQL Express, Connections and triggers

    not completely... it happens within that context of the connection - transactions will be respected, as will user permissions, so if in the trigger it tries to write to a table the user doesn't have access to, it will fail (it should at least). It doesn't need additional connections since the action is being performed on the server.... it's the same if you called a stored procedure, which then called another, which in turn called another and so on.... it's all within that same single connection.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: SQL Express, Connections and triggers

    Think about what a connection is for. It's just a pipe for transferring data between the client and the server. The trigger isn't going to transfer any data between the client and the server so what use does it have for a connection at all? When you open a connection a session is created and any operations that you initiate over that connection occur within that session, but they don't have anything to do with the connection.

    Consider this. You ring up the takeaway store and order some food. The person you spoke to tells someone else to make part of it. Do you need to make a separate phone call to tell that person to make their part?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

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



Click Here to Expand Forum to Full Width