DataBase trigger

T

Tony Johansson

Hello!

I log in to SqlServer 2005
I right click on the database and select new Query.
Here I enter the create trigger command shown below and then click on the !
to run the command
The output was Command(s) Completed successfully
When I know look in folder Database Trigger within Programmability I can't
find the created trigger.

If I try to run the create trigger command again I get an error saying
"Msg 2714, Level 16, State 2, Procedure CategoryDelete, Line 4
There is already an object named 'CategoryDelete' in the database."

So my question is where can I find the trigger that I have created ?

create trigger CategoryDelete
on Categories
for delete as
update Products SET Discontinued = 1
FROM Products INNER JOIN Deleted ON
Products.CategoryID = Deleted.CategoryID

//Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top