Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2005
    Posts
    127

    Unanswered: how to access the info of a table created in other database

    SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'tab_db1'

    The above query will give the information of the table 'tab_db1' if it is available in the current database (say db1) connected.

    How can i access the information of a table (say 'tab_db2') which is created under a different database say db2 from the current db connected say db1.

    I tried the above query with changing the table_name to 'db2..tab_db2'
    but went invain.

    sysobjects also dint work..

    Any help on this will be appreciated..

    regards,
    Sathya V
    Last edited by Shefu; 08-24-06 at 08:38.

  2. #2
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040
    select * from db2.information_schema.tables

    -- This is all just a Figment of my Imagination --

  3. #3
    Join Date
    Apr 2005
    Posts
    127
    Thanks Tom, for answering my query!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •