Results 1 to 4 of 4

Thread: How to SQL Update trigger example Deleted

  1. #1
    Join Date
    Apr 2008
    Posts
    264

    How to SQL Update trigger example Deleted

    I'm trying to create a simple cascade delete trigger in SQL Server 7 where deleting "parent" records in table X delete corresponding child records in table Y. When I want to change the coach of the given club, i have to update the club table. So i have to change idCoach of that club. The 'off the shelf' application does strange things as, in only one transaction, inserting a row and immediately deleting it..

  2. #2
    Join Date
    Feb 2009
    Posts
    117

    Re: How to SQL Update trigger example Deleted

    The inserted table stores copies of the affected rows during INSERT and UPDATE statements. The main consideration is that you cannot have declarative referential integrity in place when you perform cascading actions in triggers in SQL 7. DDL triggers execute in response to a variety of data definition language (DDL) events. These events primarily correspond to Transact-SQL CREATE, ALTER, and DROP statements, and certain system stored procedures that perform DDL-like operations. A database trigger is procedural code that is automatically executed in response to certain events on a particular table or view in a database.

  3. #3
    Join Date
    Jan 2009
    Posts
    143

    Re: How to SQL Update trigger example Deleted

    I suggest this might not be an appropriate use for triggers, which are very difficult to debug, Some systems also support non-data triggers, which fire in response to Data Definition Language (DDL) events such as creating tables, or runtime events such as logon, commit, and rollback, and may also be used for auditing purposes. Each trigger operates within the same transaction that the statement that caused the delete, insert or update is in.

  4. #4
    Join Date
    Oct 2008
    Posts
    167

    Re: How to SQL Update trigger example Deleted

    There are "BEFORE triggers" and "AFTER triggers" which run in addition to any changes already being made to the database, and "INSTEAD OF trigger" which fully replace the database's normal activity. Logon triggers fire in response to the LOGON event that is raised when a user sessions is being established. Triggers can be created directly from Transact-SQL statements or from methods of assemblies that are created in the Microsoft .NET Framework common language runtime.

Similar Threads

  1. Installing ipod update 5.0.1 deleted Backup
    By Honeykay in forum Portable Devices
    Replies: 4
    Last Post: 16-02-2012, 05:01 AM
  2. Replies: 4
    Last Post: 03-12-2010, 07:33 AM
  3. How to automatically trigger a sound
    By GILBERT in forum Operating Systems
    Replies: 3
    Last Post: 02-02-2009, 11:13 AM
  4. Update problem with deleted rows in VB
    By Daiwik in forum Software Development
    Replies: 3
    Last Post: 15-01-2009, 11:26 PM
  5. What is Trigger in sql?
    By zoaib in forum Software Development
    Replies: 3
    Last Post: 30-12-2008, 08:12 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,119,741.53125 seconds with 17 queries