Announcement

Collapse
No announcement yet.

SQL Trigger Help

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL Trigger Help

    Hey Everyone,

    I just need a quick check as I'm relatively rusty on SQL. I'm making a trigger that will run on an INSERT into Table A and copy that same data to Table B. What I have right now is:

    CREATE TRIGGER table_copy
    ON OldDatabase.dbo.OldTable
    Insert
    Begin
    Insert INTO NewDB.dbo.NewTable
    End
    Go

    A couple things I'm fuzzy on are whether this will stay in the system like a stored proc and general syntax verification. It's been far too many years since I've had to mess with SQL so I'm just making sure I'm still mostly correct.
    Last edited by mkaminski; 23rd November 2011, 21:53.
Working...
X