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 2005 Forums
 Other SQL Server Topics (2005)
 find in all procedure

Author  Topic 

wided
Posting Yak Master

218 Posts

Posted - 2010-06-08 : 11:06:48
I use sql2000
I have many stored procedures, il want to find all procedure
ho use a variable @var1

thanks

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-06-08 : 11:19:12

select routine_name from information_schema.routines
where routine_type='PROCEDURE' and object_definition(object_id(routine_name)) like '%@var1
%'

Madhivanan

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

wided
Posting Yak Master

218 Posts

Posted - 2010-06-08 : 12:25:46
thanks madivanan

select routine_name from information_schema.routines : is ok
select routine_name from information_schema.routines
where routine_type='PROCEDURE' : is ok

but i have an error if i continue
and object_definition(object_id(routine_name)) like '%@var1
the error ( object_definition is not Recognized)

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-06-09 : 02:56:08
Which version of SQL Server are you using?

Madhivanan

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

wided
Posting Yak Master

218 Posts

Posted - 2010-06-09 : 04:01:17
hi

i user sql server 2000
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-06-09 : 04:04:56
Try this

select routine_name from information_schema.routines
where routine_type='PROCEDURE' and routine_definition like '%@var1%'

But routine_definition is limited to 4000 characters

Madhivanan

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

wided
Posting Yak Master

218 Posts

Posted - 2010-06-09 : 04:17:52
thanks madhivanan
it is ok
Go to Top of Page
   

- Advertisement -