views:

307

answers:

4

i can right click on a table and go to the Triggers folder and click "New Trigger". I can then fill out the SQL for the trigger but when i click save, it just wants to save it to a ".sql" file.

How to i "commit" this trigger to the table ?

EDIT:

as per my comment below, i did hit execute but it wasn't showing up in the "Triggers" folder. It looks like you have to click "Refresh" for it to show up.

+2  A: 

Hit Execute or F5

Nick
Ah i didn't hit "refresh" next to the triggers folder, so thats why i didn't see it.
ooo
Old Schoolers use Alt-X !
Andrew
A: 

You just run the trigger, it should start with CREATE TRIGGER, so just hit execute

Glenn Slaven
A: 

The code that is generated is "CREATE TRIGGER" code... when you put your trigger inside, you need to execute (F5) this entire query, which saves it to the database. Then click on the 'Triggers' folder for the table and hit F5 again to refresh, and you'll see your trigger.

Michael Bray
A: 

SQL Server Management Studio is simply providing you with a template for a Create Trigger script. You must run the script on the Database Server for it to actually modify your Database.

duckworth