0

Looking to see how many sysobjects uses tables from a particular database. I am running a query in sysobjects in DB (and ssis packages) to confirm how many object we would need to review before we embark.. is there a way to identify tables used without code review?? Looking for anything from DATAbASEA with keyword "DATABASEB". use databaseA

SELECT OBJECT_NAME(id)
FROM syscomments 
WHERE 
[text] like '%DatabaseB%'
--and [text] like '%''F''%'
AND OBJECTPROPERTY(id, 'IsProcedure') = 1 
GROUP BY OBJECT_NAME(id)
suki
  • 63
  • 6
  • It's helpful to tag database questions with both the appropriate software (MySQL, Oracle, DB2, ...) and version, e.g. `sql-server-2014`. Differences in syntax and features often affect the answers. Note that `tsql` narrows the choices, but does not specify the database. – HABO Oct 11 '18 at 19:19

1 Answers1

0

sp_MSforeachtable @command1="SELECT '?' as TableName EXEC sp_depends @objname = N'?'" ;

Jason Byrd
  • 566
  • 3
  • 7