Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query INFORMATION_SCHEMA.TABLES on Linked Server?

Status
Not open for further replies.

Sheco

Programmer
Jan 3, 2005
5,457
US
When I'm using the local server I can get a list of tables in my database like this:
SELECT * FROM MyDatabase.information_schema.TABLES

I can get a list of tables in the master like this:
SELECT * FROM master.information_schema.TABLES

I have a linked server named LinkSVR. There is a database named RemoteDB on the linked server.

To pull all the data from a table in RemoteDB, I can do this:
[tt]SELECT * FROM LinkSVR.RemoteDB.dbo.SomeTable[/tt]

So if that works, why wont this:
[tt]SELECT * FROM LinkSVR.RemoteDB.INFORMATION_SCHEMA.TABLES[/tt]


This following works, but of course it only shows tables in LinkSVR.master:
[tt]SELECT * FROM LinkSVR.master.INFORMATION_SCHEMA.TABLES[/tt]

How can I get a look at the tables in LinkSVR.RemoteDB ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top