SELECT type ,name, create_date, modify_date
FROM sys.objects
WHERE type in('P','FN') and name = ''-- write name of function or sp
ORDER BY modify_date DESC
-- this one shows type like : FN for function and P for stored procedure
To get the table name from all the list of sp
SELECT
OBJECT_NAME(m.object_id) AS ProcedureName,
m.definition AS ProcedureDefinition
FROM sys.sql_modules AS m
WHERE
m.definition LIKE '%INSERT INTO table name%'
-- You can further refine this condition to match specific tables or criteria if needed
ORDER BY ProcedureName;
-To get name of sp
SELECT Name,*
FROM sys.procedures
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%PONUMBER%'
SELECT c.name AS 'ColumnName'
,t.name AS 'TableName',c.*
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.name LIKE '%keyworkd need to search%'
ORDER BY TableName