Browse by Tags

TSQL to find all triggers in a database including their count
23 August 07 01:28 AM | SQL Master | 2 Comments   
For SQL Server 2000 version: SELECT S2.[name] TableName, S1.[name] TriggerName, CASE WHEN S2.deltrig = s1.id THEN 'Delete' WHEN S2.instrig = s1.id THEN 'Insert' WHEN S2.updtrig = s1.id THEN 'Update' END 'TriggerType' , 'S1',s1.*,'S2',s2.* FROM sysobjects Read More...
How do I find all the tables and indexes that are partitioned?
17 July 07 02:42 AM | SQL Master | 1 Comments   
If you have a huge number of partitioned tables and indexes then the following query would help you to identify the list of objects that are involved. USE <database_name>; GO SELECT SCHEMA_NAME(o.schema_id) AS schema_name ,OBJECT_NAME(p.object_id) Read More...
How do I view the definition of a server-level trigger?
16 July 07 05:43 AM | SQL Master | 0 Comments   
SELECT definition FROM sys.server_sql_modules; GO Books online documented the usage of triggers for the business needs: Creates a DML, DDL, or logon trigger. A trigger is a special kind of stored procedure that automatically executes when an event occurs Read More...
Filed under: , , ,