How are triggers restored?

  • I restored all system & application databases from backup to a brand new server, but the triggers weren't restored. How do I go about getting my triggers back?

    Thank you

  • When a backup is restored the DB is recreated in exactly the same state it was at the time it was backed up. If there are no triggers in the restored database either there were no triggers in the DB at the time it was backed up or they were dropped after the restore completed.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I agree with Gail here.

    If you restored the system databases, then any server scoped DDL triggers would have been restored. If you restored User databases, then database scoped DDL triggers and DML triggers would have been restored.

    If you have no triggers in the restored database, then they weren't in the original database.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • You say "restore" but did you run a command BACKUP DATABASE and a command RESTORE DATABASE or did you use some sort of migration routine or the Copy Database wizard? If you did a backup and a restore, as Gail & Cirque have already said, it's an exact copy.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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