August 21, 2008 at 6:19 am
Hi
How can I retrive list tables containing a word from a DB
thanks
sarat 🙂
Curious about SQL
August 21, 2008 at 6:36 am
SELECT * FROM SYS.TABLES WHERE NAME LIKE '%string%'
where string is word or table name to be serached
Thanks,
Amit Khanna
August 21, 2008 at 6:40 am
This should work:
SELECT t.TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES t
WHERE t.TABLE_NAME like '%some%'
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
August 22, 2008 at 3:09 am
one more query..
select object_name(object_id), * from sys.objects where object_name(object_id) like 'sys%' and type = 'U'
Abhijit - http://abhijitmore.wordpress.com
August 22, 2008 at 5:33 am
thanku 🙂
thanks
sarat 🙂
Curious about SQL
August 22, 2008 at 5:36 am
There is clearly more than one way to skin a cat.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
August 22, 2008 at 5:39 am
Hi Abhijit
thanks for your reply...
i am getting error while executing it ..
ERROR: Invalid column name object_name and object_id
thanks
sarat 🙂
Curious about SQL
August 22, 2008 at 5:57 am
Is guess you're using MSSQL2000...
Try this one (it's a rewrite of Abhijit's code which was written for MSSQL2005):
select object_name(id), * from sysobjects where object_name(id) like 'sys%' and type = 'U'
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply