Re: How to call talbe/SP from Linked server with out database and user



On Wed, 14 Sep 2005 07:57:08 -0700, Rajesha wrote:

>Dear Friends,
>Usually we call tabal and SP like given below.
> select * from [linkedserver].[database].[dbo].[TableName]
> EXEC [linkedserver].[database].[dbo].usp_storedprocedure
>but I like to all with out database and username.
>I tryed like below
>select * from [linkedserver]...[TableName]
>OR
>select * from [linkedserver]..[user].[TableName]
>
>It's gives error
>
>Server: Msg 7313, Level 16, State 1, Line 1
>Invalid schema or catalog specified for provider 'MSDASQL'.
>OLE DB error trace [Non-interface error: Invalid schema or catalog
>specified for the provider.].
>
>Please help me to achive this.
>
>Thasks and regards,
>
>Rajesh

Hi Rajesh,

You can't leave out the databasename. A linked server might hold more
than one database, so you have to specify that part.

I believe that you can leave out the owner, but I'm not sure, and I
can't test that right now. However, it is recommended that you always
include the owner. This helps SQL Server find the object more quickly,
and it helps reduce the number of recompiles.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
.



Relevant Pages

  • Re: conflicting object names in sql server 2000
    ... The owner of the object will depend on the user ... On the local database server when it does the select * from ... she must specify the owner: ...
    (microsoft.public.sqlserver.server)
  • Re: Import Text with existing schema.ini file utility
    ... the database engine looks for schema.ini. ... As far as I know it's not possible to specify schema.ini in SQL; ... DAO is specifically designed to work with the Jet ... >> oDB.Execute strSQL ...
    (microsoft.public.access.modulesdaovba)
  • Re: Developer design Best Practices
    ... The database owner login is a special case and is not specified like a ... You can execute sp_changedbowner to specify the owner or ... > and then I move them, and the owner is dbo. ... > There is NO DBO User in our dev database!! ...
    (microsoft.public.sqlserver.server)
  • Re: KirbyBase
    ... creating objects from the database records was much easier. ... Hal, I don't know if you have had a chance to take a look at the beta yet, but I basically tried to implement a uniform way to specify one-to-one links, one-to-many links, and calculated fields in the ... I suppose it would in effect be embedding an array where all the ... My first couple of attempts at adding more complexity to KirbyBase did not honor this concept. ...
    (comp.lang.ruby)
  • Re: Database testing with automated verifications of your modifications ?
    ... Using some kind of capture/playback tool? ... Or some specify the changes in some xml file? ... but some XML file could be okay too. ... .NET that can be used for database testing? ...
    (comp.software.testing)