Trigger

  • Hai Friends

    am from india i want to know about trigger . could any body tell about trigger briefly please help me

    thanku

  • Depends on your knowledge level of database/sql. Anyway, to start with,

    I found a description in wikipedia, which goes like this,

    A database trigger is procedural code that is automatically executed in response to certain events on a particular table or view in a database. The trigger is mostly used for keeping the integrity of the information on the database. For example, when a new record (representing a new worker) added to the employees table, new records should be created also in the tables of the taxes, vacations, and salaries.

    http://en.wikipedia.org/wiki/Database_trigger

    and then on to some SQL Server trigggers,

    http://msdn.microsoft.com/en-us/magazine/cc164047.aspx

    http://msdn.microsoft.com/en-us/library/ms189799(SQL.90).aspx

    I think when you come to this site's home page, it talks about 'ASK' and 'forum'. I guess ASK is the better please for this.

    ---------------------------------------------------------------------------------

  • praveen640 (1/8/2010)


    Hai Friends

    am from india i want to know about trigger . could any body tell about trigger briefly please help me

    thanku

    As far as I know..google works fast enough in India too...:-P

    Books Online says this about Triggers:

    Microsoft SQL Server provides two primary mechanisms for enforcing business rules and data integrity: constraints and triggers. A trigger is a special type of stored procedure that automatically takes effect when a language event executes. SQL Server includes three general types of triggers: DML triggers, DDL triggers, and logon triggers.

    DDL triggers are invoked when a data definition language (DDL) event takes place in the server or database. They are explained in more detail in DDL Triggers. Logon triggers fire stored procedures in response to a LOGON event. This event is raised when a user session is established with an instance of SQL Server. For more information, see Logon Triggers.

    DML triggers are invoked when a data manipulation language (DML) event takes place in the database. DML events include INSERT, UPDATE, or DELETE statements that modify data in a specified table or view. A DML trigger can query other tables and can include complex Transact-SQL statements. The trigger and the statement that fires it are treated as a single transaction, which can be rolled back from within the trigger. If a severe error is detected (for example, insufficient disk space), the entire transaction automatically rolls back.

    The_SQL_DBA
    MCTS

    "Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."

  • Than u

  • Thanku Nabha same to u

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

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