microsoft.public.sqlserver.notificationsvcs
[Top] [All Lists]

Re: Finding out user tables in database

Subject: Re: Finding out user tables in database
From: Joe Webb
Date: Thu, 22 Dec 2005 08:39:21 -0600
Newsgroups: microsoft.public.sqlserver.notificationsvcs
Hi Mana- 

Use this statement instead:

SELECT 
        * 
FROM 
        INFORMATION_SCHEMA.TABLES
WHERE
        TABLE_TYPE = 'BASE TABLE'


BTW - a better group would be microsoft.public.sqlserver.programming.
This on is dedicated to SQL Server Notification Services. 

HTH...

-- 
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811 

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On 21 Dec 2005 20:28:10 -0800, "Mana" <[email protected]> wrote:

>Hi,
>
>I need to find out all the user tables in a database. For this purpose
>I have written following query. NSBank is the name of the database.
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>USE NSBank;
>select name, type_desc from sys.objects where type='u';
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>When I execute this, I get the names of all the user tables along with
>the table 'sysdiagrams' which is a system table, created as a result of
>relationships between other tables in the database. How should I modify
>my query to omit this table from the result set?
>
>Thanks,
>Mana

<Prev in Thread] Current Thread [Next in Thread>