Find a table by name into SQL Server 2000 and SQLServer 2005

Monday, 20 July 2009 12:31 by myro

In SQL Server 2005 you can get a list of all your Tables with a particular name using the system table sys.table:

SELECT *

FROM sys.tables

WHERE name LIKE '%YOUR_TABLE_NAME%'

but if you need to do the same task in a SQL Server 2000, you should use

use YOURDB

select *

from INFORMATION_SCHEMA.TABLES

where TABLE_NAME LIKE '%YOUR_TABLE_NAME%'

because sys.table is not supported into SQL 2000.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   Sql
Actions:   Bookmark and Share | Permalink | Comments (0) | Comment RSSRSS comment feed
If you consider this post usefull for your purposes, please consider visiting my sponsors to help me out with the myrocode.com maintenance. Thank you.