Tag Info

Hot answers tagged


You have a database trigger that logs DDL event to a table ddl_DBEvents in the database DBMonitor. You can either delete or disable the trigger from SQL Server Management Studio in the Object Explorer under YourDatabase - Programmability - Database Triggers. You could also disable or delete the trigger from code: DISABLE TRIGGER dbtrg_DBEventsmodel ON ...


Updateable View In Postgres 9.4, views are automatically updatable per column. I.e., as long as basic conditions are met, columns are automatically updatable for plain references to underlying columns. Expressions are not. We can exploit this feature: CREATE TABLE test_table( id serial PRIMARY KEY , foobar text ); CREATE VIEW test_view AS SELECT id * 1 ...


My question is why insert trigger is not fired from instead of trigger? It should because it is also using insert query in it. Why TestTable get the new inserted row? The INSTEAD OF trigger replaces the original insert. So the code: Insert into dbo.TestTable (Name,Age,DOB,Address) Select Name,Age,DOB,Address From inserted; ...is executed instead of ...


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';

Only top voted, non community-wiki answers of a minimum length are eligible