Discussion Forum

Main >> MS SQL Server and other Databases>> How can you find quickly if a string or table name is used in any stored procedure or UDF

All Threads Register Login New Discussion
AuthorPostings
Jane

How can you find quickly if a string or table name is used in any stored procedure or UDF

Friday, October 05 2018 10:10 AM

How can you find easily if a table name or a field name or any string is used in any stored procedure or user defined function in MS SQL server database?

Post a Replyreply

bthompson
Developer
Re:How can you find quickly if a string or table name is used in any stored procedure or UDF

Friday, October 05 2018 10:13 AM

USE [YourDBname];
GO
SELECT [Scehma]=schema_name(o.schema_id), o.Name, o.type
FROM sys.sql_modules m
INNER JOIN sys.objects o
ON o.object_id = m.object_id
WHERE m.definition like '%yourstring%'
GO

Post a Replyreply

AT Integrated Inc. | 913 Ridgebrook Rd Suite 109, Sparks, MD 21152 | T: 410-472-2490
Copyright © 2024 AT Integrated Inc. All rights reserved.