C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » Databases »

Getting a List of all the table Names created by the db USER


Posted Date: 07 Jul 2004    Resource Type: Articles    Category: Databases
Author: Nilanjan MitraMember Level: Bronze    
Rating: 1 out of 5Points: 7



Introduction

Simple Store Procedure to get all the List of User Defined Table Names

Code

CREATE PROCEDURE sp_GetAllTableNames
AS
Select Name from SysObjects where xType = 'U' and Name <> 'dtProperties'
GO

Summary
It helps to develop fast and generalised routines for your .NET methods.




Responses

Author: Suresh Babu    22 Jul 2004Member Level: Bronze   Points : 0
Microsoft does not recommend the direct use of System tables. SQL Server 2000 was released with many system views. So, the scrpt can be re-written as

CREATE PROCEDURE mysp_GetAllTableNames
AS
Select Table_Name from INFORMATION_SCHEMA.TABLES where table_Type='BASE TABLE' and Table_Name <> 'dtProperties'
GO

If the stored procedure is not added in the master database, do not use the prefix sp_ for stored procedures. It has a performance overhead.
Thanks,
Suresh




Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Store and Retrieve Images in SQL Server database
Previous Resource: Retrieving the Specific Row ID Records of a Table.
Return to Discussion Resource Index
Post New Resource
Category: Databases


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use