This procedure allows you to search through all objects in all databases on your server for words/phrases in your object code. Very handy for cases in which, for example, a column name on a table has been changed and you need to search your entire server for any sprocs/views/etc. that might reference it.
Syntax: [EXEC] sp_FindCodeStr [@SearchStr=]'', [@PrintOnly=]{0, 1}
Notice that no cursors or temp tables are used in this sproc. Dynamic T-SQL execution appends all the needed statements onto the @sql variable, building the batch in a set-oriented manner, and then the final batch is executed via sp_executesql. As a result, this sproc performs surprisingly well.
SP that shows information from a given database
It is used to show information from a database. It shows the creation date, it calculates the time in days, months and hours since its creation and it shows all the users with rights in that database.
2002-01-27
2,169 reads