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 ;)
  • Is that a smiley inside your code block? Best to edit that, methinks. Jul 24 '15 at 17:25
  • @MichaelGreen Yes, because that syntax definitely won't work. Some fun is allowed ;) Jul 24 '15 at 19:33

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, privacy policy and cookie policy

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