Get all stored procedures where table is being used in SQL Server -
i need query or code in sql server stored procedures in table being used in server (need stored procedures in databases on server).
select * sys.procedures object_definition(object_id) '%[dbo].[batch]%.
above query give in current database need query databases in server.
thanks. sandeep
execute master.sys.sp_msforeachdb "use [?]; select * sys.procedures object_definition(object_id) '%[dbo].[batch]%'"
just consider permutations of code references batch object (dbo.batch, [dbo].[batch], dbo.[batch], etc)
Comments
Post a Comment