This stored procedure helps you list names of all tables, stored procedure, function, view or a trigger based on the argument. Many a times, we don't remember the table name or the stored proc name. It could be the case with newbee's too. This stored procedures comes handy then. Just pass few characters of the table name, this stored procedure lists all possible table names with those characters. For example, you want to find all tables containing the characters "emp" in their names, then do the below.
exec sp_assist 'table', 'emp'
This should list all tables having "emp" in their names.
This stored procedure works for stored procedure, trigger, function, view.
Pass appropriate parameter as shown in trace and get listed the object type that you would want.
If you want to list all tables or stored procedures or function etc. then don't just pass any value to the second parameter.
Sample trace is there in the stored procedure comment section for help.
Note: This stored procedure can be expanded for other type of objects that you may want. I have just listed the basic ones.
Create this stored procedure in master database so that it is accessible to all other databases in that server.