Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Search function in store procedures

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2006-04-14 : 12:52:31
I add a function "fnHour" in a store procedure but I forgot which one. How to search this function within about 200 store procedures?

Kristen
Test

22859 Posts

Posted - 2006-04-14 : 13:02:18
[code]
SELECT O.name
FROM syscomments C
JOIN sysobjects O
ON O.id = C.id
WHERE [text] LIKE '%fnHour%'
[/code]
Kristen
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2006-04-14 : 16:24:23
No, did not work
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-04-15 : 00:53:31
Didn't list anything, or listed things that did not contain fnHour?

Kristen
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-15 : 03:18:20
is your stored procedures encrypted ?



KH


Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2006-04-15 : 08:03:29
no error but nothing
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2006-04-15 : 08:05:43
I do not know I did correct or not:
I just copy entire your code. Do I need change anything? Like [text] to meet my server?
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-04-15 : 08:08:41
either the function does not exist or you need to verify
do a reverse...
use not like
and distinct to check how many objects there are, the missing objects will be your clue...



--------------------
keeping it simple...
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-04-15 : 08:16:23
Are you sure the name what name you have specified is correct or you can try somthing like this ..

ELECT O.name
FROM syscomments C
JOIN sysobjects O
ON O.id = C.id
WHERE [text] LIKE '%Hour%'

or

ELECT O.name
FROM syscomments C
JOIN sysobjects O
ON O.id = C.id
WHERE [text] LIKE '%fn%'

and just try various filter..

If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-17 : 02:29:32
Are you sure you run that query at the correct database?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2006-04-17 : 07:00:43
I used Kristen's way. It works now! I forgot select DB.
Thank you.
Go to Top of Page
   

- Advertisement -