How many tables in a database

  • Hi there,

    Does anyone perhaps have a script that would give u the amount of tables within a database, or display the list of tables within at database

    Regards

    IC

  • You can get the information you're looking for from the INFORMATION_SCHEMA.TABLES view.

    John

  • thanks for the info, it was a lot of help.

    I also got this script from one of my colleagues:

    select

    * from sysobjects where type = 'u'

    If u do a online help search on sysobjects it will give u the information what type means.

    Regards

    IC

  • i guess it is

    select * from sysobjects where xtype='U' --->for user tables

    select * from sysobjects where xtype='S' ---> for system tables

    also u can use sp_tables sp to retrieve the tables present in a DB

    Cheers

    Deepak

    [font="Verdana"]- Deepak[/font]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply