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:
Comments
Post a Comment