[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

Query

Hi,
I have a lot SProc. in the database , and I need query search in SProc.

Thanks
0
samprg
Asked:
samprg
  • 3
  • 2
  • 2
  • +2
1 Solution
 
Ephraim WangoyaCommented:
You can search the schema routines

SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%your search text%'
AND ROUTINE_TYPE='PROCEDURE'
0
 
samprgAuthor Commented:
It is good, but did not bring  all SProc.
0
 
Ephraim WangoyaCommented:
You can try the syscomments view but I doubt you will get different results

    SELECT OBJECT_NAME(id)
    FROM syscomments
    WHERE [text] LIKE '%your search text%'
    AND OBJECTPROPERTY(id, 'IsProcedure') = 1
    GROUP BY OBJECT_NAME(id)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Anthony PerkinsCommented:
>>It is good, but did not bring  all SProc. <<
Care to elaborate?  If we do not know the specific problem we cannot give you a good solution.
0
 
jagssiduralaCommented:
try below query, i hope this will helps you

Select       name,
      *
from       sys.objects
Where       Object_Id
In
(
    Select id from syscomments where Text like '%your text here%'
)
0
 
samprgAuthor Commented:
ewangoya:
First one is beter,but I tested it gives me 2 SPro. but I have 3 SProc

acperkins:
It is very simple. I need query search in all SProc. in the database

Thanks all of you
0
 
sachinpatil10dCommented:
declare @name nvarchar(100)
set @name = 'C%'
select * from sys.objects where type_desc = 'SQL_STORED_PROCEDURE'
and name like @name
0
 
Anthony PerkinsCommented:
>>It is very simple. I need query search in all SProc. in the database<<
Unfortunately that tells us nothing.

Good luck.
0
 
samprgAuthor Commented:
Awesom
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now