Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin.
Search for scripts directly from SSMS, and instantly access any saved scripts in your
SSC briefcase from the favorites tab.
Download now (direct download link)
Thank this author by sharing:
By suba sathyanathan,
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.
Calling Scalar Function within stored Procedure
Call Stored Procedure from a Function
Implementing a function within a stored procedure
Calling an Oracle Stored Procedure and Function over linkedServer
Can I call Stored procedure in User defined function?
As a member of SQLServerCentral, you get free access to loads of fresh content: thousands
of articles and SQL scripts, a library of free eBooks, a weekly database news roundup,
a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals
that makes it such a success.