1

I have a Uni assignment due, part of it requires this:

"Create a database trigger called “TRG_PREVENT_VIEW_DROP” that will prevent the dropping of any view

The trigger must log the action in a separate table called event logs and include the following data; the user, date/time, attempt type and view name. The attempt_type and view name data must not be hard coded. "

It's got me stumped, any help will be greatly appreciated, cheers

Matt
  • 11
  • 2
  • 1
    What do you mean by "it's got me stumped" - what part do you not understand? Do you know how to write a trigger? Did your course material not provide any clues as to how to approach this? (It's a crap course if it didn't) – Philᵀᴹ Jun 09 '16 at 11:39
  • Hi Phil, the part I'm having trouble with is the attempt_type and view_name columns data cannot be hard coded in the trigger, we have make it populate the event_logs table dynamically. The user and date/time columns I've used the SYSTEM_USER () and GETDATE() functions but can't figure out how to populate the other columns with DROP_VIEW for the attempt_type column, and VW_ALL_SHAPES for the view_name column without hardcoding the values in, which we're not allowed to do – Matt Jun 09 '16 at 11:49

0 Answers0