Reputation: 91
I am using sql server connections in sql developer with the help of a plug-in...
Now my question is I have a list of tables which belong to sql server connections but I don't have the information on, which table belongs to which schema?
I have tried using the script
select owner, table_name from all_tables where table_name like 'xxxxxxxx%';
but it didn't work out, can any one please help out on this???
Thanks in advance!!!
Upvotes: 3
Views: 8759
Reputation: 3222
@Ben Thul has an answer that is absolutely fine.
This is just an alternative using INFORMATION_SCHEMA
(both of which essentially use sys.objects under the hood):
SELECT
t.TABLE_CATALOG
,t.TABLE_SCHEMA
,t.TABLE_NAME
,t.TABLE_TYPE
FROM INFORMATION_SCHEMA.TABLES t
WHERE t.TABLE_NAME LIKE '%<YOUTABLE>%'
Upvotes: 2
Reputation: 32687
Select schema_name (schema_id), name
from sys.tables
where name like 'your pattern'
Upvotes: 2