December 3, 2010 at 8:58 am
I have a table name and I want to know which database contains that table. How do I find out?
Thanks.
December 3, 2010 at 10:26 am
Run a query against the information_schema.tables view in each database on the server to find out the one(s) it is in.
December 3, 2010 at 10:56 am
you can run the following query :
EXECUTE sp_msforeachdb 'select * from ?.information_schema.tables where table_name = ''articles'''
December 3, 2010 at 12:30 pm
Thank you, that works.
April 26, 2012 at 3:24 am
select * from information_schema.tables where table_name = 'articles'
Error starting at line 1 in command:
select * from information_schema.tables where table_name = 'articles'
Error at Command Line:1 Column:33
Error report:
SQL Error: ORA-00942: table or view does not exist
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
i am running the above query in SQLDeveloper tool.
plz give alternate solution.
April 26, 2012 at 3:37 am
I'm guessing one or more of your databases have a case-sensitive collation. The name of the INFORMATION_SCHEMA schema and the views within it are upper case.
John
April 26, 2012 at 10:14 pm
NO IT IS ALSO NOT WORKING>>>SAME ERROR AGAIN
:crying:
but thanks for ur respond....
chandan
April 27, 2012 at 1:49 am
i am running the above query in SQLDeveloper tool.
What happens if you run it in SSMS? Also, that error message does not look like one generated by SQL Server. Are you sure you're running the query against a SQL Server database?
John
April 27, 2012 at 4:12 am
no i m running it against ORACLE database
chandan
April 27, 2012 at 4:13 am
Case solved. You need to post on an Oracle forum.
John
April 27, 2012 at 4:51 am
sry,thats not my ans.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply