I would like to document the stored procedures defined on my db, for example I have this procedureCREATE PROCEDURE [dbo].[usp_deletebwusers] -- Add the parameters for the stored procedure hereASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; DISABLE TRIGGER tr_count_users ON dbo.bwusers; exec usp_countbwusers -- Insert statements for procedure here DELETE FROM BWUSERS WHERE USR_USERID = 'ME' AND USR_APPLID = 'APPL' ENABLE TRIGGER tr_count_users ON dbo.bwusers;END
If I execute the following query:SELECT DISTINCT sd.object_id, OBJECT_NAME(sd.object_id) as stored_procedure, type, type_desc, ReferencedObject = OBJECT_NAME(sd.referenced_major_id), ReferencedObjectID = sd.referenced_major_id, is_selected, is_updated, is_select_allFROM sys.sql_dependencies sd JOIN sys.objects so ON sd.referenced_major_id = so.object_idWHERE OBJECT_NAME(sd.object_id) = 'usp_deletebwusers'
I'm able to find:-the access to BWUSERS table-the execution of usp_countbwusersbut I've no info about "DISABLE TRIGGER tr_count_users" and "ENABLE TRIGGER tr_count_users"