SAP Business One SDK Support

Check Tables in View \ Procedure \ SQL Job

Most of the cases, it will difficult to find where the table or column or procedure is used any where in the Procedures in the database; Below quires will help to search through the data base and find the table or procedure the keywords are used


Below query will help to check the table is used any where in View or Procedure


SELECT j.Name, s.Database_name, s.Command
FROM msdb.dbo.sysjobsteps s
INNER JOIN msdb.dbo.sysjobs j
ON s.job_id = j.job_id
WHERE s.command LIKE '%TableName%'
AND s.database_name LIKE '%DBName%'



Below query will help to check the table is used any where in SQL Job

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