To get details of a table
select *
from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME like '%tablename%'
To get all dependencies of a table via script
SELECT referencing_schema_name, referencing_entity_name,
referencing_id, referencing_class_desc
FROM sys.dm_sql_referencing_entities ('dbo.Address', 'OBJECT')
GO
To get stored procedures referencing a table
SELECT name, OBJECT_SCHEMA_NAME(object_id)
FROM sys.procedures
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%tablename%'
No comments:
Post a Comment