sql - Search stored procedures/functions in all databases -


i want search specific text in procedures/functions etc. in databases. managed create required query answer looks object_definition(object_id(specific_name)) returns null dbs except current one.

sp_msforeachdb 'select ''?'' db, specific_name, object_definition(object_id(specific_name)) [?].information_schema.routines' 

the problem object_id cannot used way. works on current database. try returning routine_definition directly information_schema.routines. have limit of 4000 characters. i'll try find other answer on gives workaround using ms metadata views.

have @ this:

can search sql server 2005 stored procedure content?


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -