Looking up Table Schema info

  • I'm running the code below and although it gives me most of the table information I'm looking for, it's not giving me the schema info, such as "dbo", "jdoe", etc. How can I run this script to include the table schema info, or do I need to run something different.

    Selecttop 10 * From Sysobjects where type = 'U'

    thx,

    John

  • you can use "information_schema.tables" instead!


    * Noel

  • If you're using sql 2005 (as I assume you are from where this is posted):

    select schema_name(schema_id), name from sys.objects where type='U'

    or

    select schema_name(schema_id),name from sys.tables

  • Thanks guys....

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

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