Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    NJ
    Posts
    37

    Unanswered: **RESOLVED** how do i retrieve the available tables in a database

    I need to retrieve the available tables in a database in SQL Server 2000. I found this command and although it works I can't figure out how to filter the results.

    exec sp_tables

    I don't want to return the whole list, just the tables starting with "OV" and "SV". Does SQL Server 2000 support a wildcard? Like can I have it search for "OV*" or do I have to use LIKE. Did google search with no helpful results. I remember in mySQL this was simply "SHOW Tables" but this command isn't supported in SQL Server 2000.

    any help would be appreciated

    thanks
    Last edited by goodolE22; 09-20-04 at 10:28.

  2. #2
    Join Date
    Feb 2004
    Location
    NJ
    Posts
    37

    Resolved

    Figured it out.. used the following command:

    SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME Like 'OV%' OR TABLE_NAME Like 'SV%' OR TABLE_NAME Like 'TV%';

Posting Permissions

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