퇴근 할려는데 카톡으로 쿼리로 SP 주석 제거 할 수 있는 방법 물어 보길래 한번
만들어 봤습니다.
SELECT REPLACE(ss.definition,
SUBSTRING(ss.definition, CHARINDEX('/*', ss.definition) - 2,
CHARINDEX('*/', ss.definition) + 4 - CHARINDEX('/*',
ss.definition)),
'') AS [주석제거SP],
ss.definition [기존SP]
FROM Admin.sys.objects AS so
INNER JOIN Admin.sys.sql_modules AS ss ON so.object_id = ss.object_id
WHERE so.schema_id = 1
AND type = 'P'
AND ss.definition LIKE '%/*%'