Sunday, 25 February 2018

To get dependent SP's name in which the SP/Table is using_in Sql Server

1.To get dependent SP's name in which the table is using.(means-table's used by which SP's)

SELECT DISTINCT so.name
FROM syscomments sc
INNER JOIN sysobjects so ON sc.id=so.id
WHERE sc.TEXT LIKE '%occ_order_approvals%'

2.To get dependent SP's name in which the SP is using.(means-SP used by which SP's)

sp_whereiscolumn 'SP_ORDER_GEN_NUM'

3.Get SP names by any related text names

SELECT name
FROM sys.procedures
WHERE Object_definition(object_id) LIKE '%deletecandidatefromcloud%'

4.For performance issue...run below SP

exec sp_updatestats


No comments:

Post a Comment