1

I would like to recompile my logon trigger using sp_recompile. But I can't figure out the syntax.

E.g. these don't work:

sp_recompile '[Tr_Logon]'

sp_recompile '[Tr_Logon]' ON ALL SERVER ;)
2
  • Is that a smiley inside your code block? Best to edit that, methinks. Commented Jul 24, 2015 at 17:25
  • @MichaelGreen Yes, because that syntax definitely won't work. Some fun is allowed ;) Commented Jul 24, 2015 at 19:33

1 Answer 1

3

I think I found it:

sp_refreshsqlmodule (Books Online)

Updates the metadata for the specified non-schema-bound stored procedure, user-defined function, view, DML trigger, database-level DDL trigger, or server-level DDL trigger in the current database.

EXEC sys.sp_refreshsqlmodule
    @name = 'ddl_trig_name',
    @namespace = 'SERVER_DDL_TRIGGER';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.