Is it possible to switch to a database on a linked server using a 'USE' statement in SQL Server 2005?
I've tried the obvious:
USE linkedServerName.databaseName
Which gives me the error:
`Could 开发者_如何学Gonot locate entry in sysdatabases for database 'linkedServerName'.
If something like this were possible, it'd save me a bunch of clicking around in management studio!
Linked server definitions are designed for use as part of the four-part naming convention:
[LinkedServerDefinition.][DatabaseName.][SchemaName.]DatabaseObject
for example, OtherServer.Database.dbo.MyTable
They might have other uses, but with the USE statement is not one of them.
Would
SELECT * from LinkedServerDefinition.master.sys.databases
help in identifying what databases are "over ther"?
精彩评论