declare @DBName nvarchar(30)
set @DBName = 'DBName'
SELECT
p.name as procName
, COALESCE(d.referenced_server_name , N'') as refServer
, COALESCE(d.referenced_database_name, @DBName) as refDB
, COALESCE(d.referenced_schema_name , N'dbo') as refSchema
, d.referenced_entity_name as refObject
FROM DBName.sys.sql_expression_dependencies AS d
join DBName.sys.procedures as p
on d.referencing_id = p.object_id
group by
p.name
, COALESCE(d.referenced_server_name , N'')
, COALESCE(d.referenced_database_name, @DBName)
, COALESCE(d.referenced_schema_name , N'dbo')
, d.referenced_entity_name
'SQL Server' 카테고리의 다른 글
SQL 계정생성 및 권한할당 (0) | 2019.08.21 |
---|---|
DB 백업 & 복구 스크립트 (0) | 2019.06.27 |
DB 업그레이드 절차 (0) | 2013.07.04 |
tempdb 튜닝 (0) | 2013.07.04 |
DB 이전 후 계정 변경 (0) | 2013.04.30 |