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 ;)
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
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';