How to search for a string in all stored procedure in SQL Server?
Submitted by: Administrator-Suppose we have a EmpDetails table in our database and there are certain number of stored procedures in database. We want to know in which stored procedure(s) table EmpDetails is used.
-We can use following query
SELECT
sys.objects.name, sys.objects.type, sys.objects.type_desc,
sys.objects.schema_id, sys.syscomments.text
FROM sys.objects
INNER JOIN sys.syscomments ON sys.objects.object_id = sys.syscomments.id
where sys.syscomments.text like '%EmpDetails%'
And type ='P'
Submitted by: Administrator
-We can use following query
SELECT
sys.objects.name, sys.objects.type, sys.objects.type_desc,
sys.objects.schema_id, sys.syscomments.text
FROM sys.objects
INNER JOIN sys.syscomments ON sys.objects.object_id = sys.syscomments.id
where sys.syscomments.text like '%EmpDetails%'
And type ='P'
Submitted by: Administrator
Read Online SQL Database Concepts Job Interview Questions And Answers
Top SQL Database Concepts Questions
☺ | Explain what are Magic tables in SQL Server? |
☺ | Do you know how to send email from database? |
☺ | How to search for a string in all stored procedure in SQL Server? |
☺ | Explain how to use Linked Server? |
☺ | Explain difference between cross join and Full outer join? |
Top New MS SQL Server Categories
☺ | SQL Server Database Administrator Interview Questions. |
☺ | SQL Server Service Broker Interview Questions. |
☺ | SQL Server Locks Interview Questions. |
☺ | SQL Server Constraints Interview Questions. |
☺ | MS SQL Data Mining Interview Questions. |