September 5, 2022 at 12:00 am
Comments posted to this topic are about the item Saving Labor
September 7, 2022 at 11:28 am
Try this (adjust for your needs), then execute the output script:
set nocount on
select DISTINCT 'exec sp_helptext ' AS '--','[' + o.name + ']' AS [ ],CASE OBJECTPROPERTY(o.id,'ExecIsTriggerDisabled') WHEN 1 THEN '--Disabled' ELSE '' END AS [---]
from sysobjects o(readuncommitted) where o.name COLLATE SQL_Latin1_General_CP1_CI_AS
like '%%'
and o.xtype IN(''
,'P '--: stored procedure'
--,'IF'/*: inline function'*/,'FN'/*: scalar function'*/,'TF'/*: table function'*/
--,'TR'--: trigger'
--,'AP'--: application'
--,'V '--: view'
--,'U '--: user table'
--,'S '--: system table'
--,'C '--: check cns'
--,'F '--: foreign key cns'
--,'D '--: default (maybe cns)'
--,'PK'--: primary key cns'
--,'UQ'--: unique key cns'
--,'X '--: extended stored proc'
)
and o.name not like 'dt[_]%'
order by [---],[ ]
set nocount off
The trick is the store procedure sp_helptext.
This version also works starting from Sql2000
May 11, 2023 at 1:25 pm
Mmmm... the question said "without spending a lot of time", so I chose the fourth option!
John
Edit: scrub that - I didn't read the Explanation properly.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply