Link artículo
Search Columns:
SELECT c.name AS 'ColumnName'
,t.name AS 'TableName'
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.name LIKE '%MyName%'
ORDER
BY
TableName
,ColumnName;
Search Tables
& Views:
SELECT COLUMN_NAME AS
'ColumnName'
,TABLE_NAME
AS 'TableName'
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME LIKE
'%MyName%'
ORDER BY TableName
,ColumnName;
Search Stored Procedures
Search Columns into SPs
Search Stored Procedures
SELECT
DISTINCT
o.name AS Object_Name,
o.type_desc
FROM sys.sql_modules m
INNER JOIN
sys.objects o
ON m.object_id = o.object_id
WHERE m.definition Like '%[ABD]%';
Search Columns into SPs
SELECT DISTINCT
o.name AS Object_Name,
o.type_desc
FROM sys.sql_modules m
INNER JOIN
sys.objects o
ON m.object_id = o.object_id
WHERE m.definition Like '%[ABD]%';
Search table in SPs
Search table in SPs
SELECT Name
FROM sys.procedures
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%t_GMGC_TMP_HistoricoPagos%'
No hay comentarios:
Publicar un comentario