0
에 삭제합니다., I는 다음과 같은 기본 로직을 저장 프로 시저의 여지가 데이터베이스
어떤 저장 프로 시저가 데이터베이스에 도달했는지 어떻게 알 수 있습니까?
일부 저장 프로 시저에는 데이터베이스 자체를 손상시키는 다른 저장 프로 시저가 있습니다.
에 삭제합니다., I는 다음과 같은 기본 로직을 저장 프로 시저의 여지가 데이터베이스
어떤 저장 프로 시저가 데이터베이스에 도달했는지 어떻게 알 수 있습니까?
일부 저장 프로 시저에는 데이터베이스 자체를 손상시키는 다른 저장 프로 시저가 있습니다.
는 저장 프로 시저가 다음 스크립트는
SELECT m.object_id,o.name,c.*,o.type,o.type_desc FROM sys.all_sql_modules AS m
INNER JOIN sys.objects AS o ON o.object_id=m.object_id
OUTER APPLY(
SELECT
coalesce(object_schema_name(Referencing_ID)+'.','')+ --likely schema name
object_name(Referencing_ID)+ --definite entity name
coalesce('.'+col_name(referencing_ID,referencing_minor_id),'')
AS [referencing],
coalesce(Referenced_server_name+'.','')+ --possible server name if cross-server
coalesce(referenced_database_name+'.','')+ --possible database name if cross-database
coalesce(referenced_schema_name+'.','')+ --likely schema name
coalesce(referenced_entity_name,'') + --very likely entity name
coalesce('.'+col_name(referenced_ID,referenced_minor_id),'')AS [referenced]
FROM sys.sql_expression_dependencies
WHERE referencing_id =m.object_id
) AS c
WHERE o.type='P'
AND c.referencing IS NULL
안녕 놀란, 큰 SQL 쿼리에 대한 도움이되는 데이터베이스의 참조 데이터 오브젝트를? 있던 알고 싶지 않아! 참고로, 데이터베이스 객체를 참조하는 SP가 마지막으로 cluase 조건은 "c.referencing IS NOT NULL"이 될 것입니다. – Eralper