I've finaly gotten a Linke Server up and running and been playing around with the settings, and one question keeps bugging me.
What is the point of the Catalog property value when you always have to put that database in the four part naming anyways?
Thanks.
I believe it is for linked server configuration and testing...
If you don't want use four part name all the time, you can create Synonyms in sql server 2005
Check BOL for topic 'Synonyms '
|||
Flip wrote:
What is the point of the Catalog property value when you always have to put that database in the four part naming anyways?
The Catalog property does a couple of things for you. First it allows you to not have to specify the actual database name.
Code Snippet
SELECT *
FROM SERVER..dbo.sysfiles
Also, when you execute code against a linked server if you look at sp_who2 on the remote server it will always show the logins default database for the database which you are executing code against. If you set the Catalog field this will show as the database which is being used for the connection default.
|||Thank you for the response. Have you tried this exact code before? In my testing, I was not able to get this to work (as much as I hoped it would :>).
When I try it out (like you said, with the Catalog set to the desired db and without the db name in the query), I get the following error.
OLE DB error trace [Non-interface error: Invalid schema or catalog specified for the provider.].
Msg 7313, Level 16, State 1, Line 1
Invalid schema or catalog specified for provider 'SQLOLEDB'.
Am I missing something, or maybe I have a bad setting/property?
Thanks.
sql
No comments:
Post a Comment