Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

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)

Lists tables, Stored Procedures and other Objects

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.

Total article views: 1632 | Views in the last 30 days: 8
 
Related Articles
FORUM

Calling Scalar Function within stored Procedure

Calling Scalar Function within stored Procedure

FORUM

Call Stored Procedure from a Function

Call Stored Procedure from a Function

FORUM

Implementing a function within a stored procedure

Implementing a function within a stored procedure

FORUM

Calling an Oracle Stored Procedure and Function

Calling an Oracle Stored Procedure and Function over linkedServer

FORUM

Stored procedure in User defined function?

Can I call Stored procedure in User defined function?

 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

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.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones