****************프로시져 ************************
DECLARE @NAME VARCHAR(100)
SET @NAME = ''
DECLARE CUR1 CURSOR FOR
SELECT name FROM SYS.procedures WHERE name LIKE 'USP_%'
OPEN CUR1 FETCH NEXT FROM CUR1 INTO @NAME
WHILE (@@FETCH_STATUS = 0)
BEGIN
PRINT '===================== START ========================='
EXEC sp_helptext @NAME
PRINT '======================= END ======================='
FETCH NEXT FROM CUR1 INTO @NAME;
END
CLOSE CUR1;
DEALLOCATE CUR1;
****************함수************************
DECLARE @NAME VARCHAR(100)
SET @NAME = ''
DECLARE CUR1 CURSOR FOR
SELECT name FROM SYS.objects WHERE name TYPE = 'FN'
OPEN CUR1 FETCH NEXT FROM CUR1 INTO @NAME
WHILE (@@FETCH_STATUS = 0)
BEGIN
PRINT '===================== START ========================='
EXEC sp_helptext @NAME
PRINT '======================= END ======================='
FETCH NEXT FROM CUR1 INTO @NAME;
END
CLOSE CUR1;
DEALLOCATE CUR1;
****************트리거************************
DECLARE @NAME VARCHAR(100)
SET @NAME = ''
DECLARE CUR1 CURSOR FOR
SELECT name FROM SYS.triggers WHERE name LIKE 'TR_%'
OPEN CUR1 FETCH NEXT FROM CUR1 INTO @NAME
WHILE (@@FETCH_STATUS = 0)
BEGIN
PRINT '===================== START ========================='
EXEC sp_helptext @NAME
PRINT '======================= END ======================='
FETCH NEXT FROM CUR1 INTO @NAME;
END
CLOSE CUR1;
DEALLOCATE CUR1;
참고 프로시져 : sys.procedures 트리거 : sys.triggers 함수 : sys.objects
'DB' 카테고리의 다른 글
[MSSQL] [1주,2주,3주] 주차로 SEQ 생성하기 (0) | 2024.02.23 |
---|---|
[MSSQL] LOCK 걸린거 찾기 (0) | 2024.02.22 |
[MSSQL] MERGE 문법 (0) | 2024.02.21 |
[오라클] ANSI Join 에 using문 사용 (0) | 2024.02.20 |
[MSSQL] 날짜 구하기 (1) | 2024.02.20 |