|
Home > Archive > MS SQL Server MSEQ > September 2005 > How to call talbe/SP from Linked server with out database and user
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to call talbe/SP from Linked server with out database and user
|
|
| Rajesha 2005-09-14, 11:23 am |
| 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
| |
| Hugo Kornelis 2005-09-15, 8:24 pm |
| 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)
|
|
|
|
|