May 25, 2011 at 8:20 am
I have a linked server setup when I run the following script
select top 10 * from s22.database.table.column it works fine but when I try to query a database on the server and join a table from the linked server I get the following error.
The Multi-part identifier 's22.database.dbo.table.column could not be bound.
Original query
select
customer.key,
s22.database.dbo.table.column
from s22.database.dbo.table.colum
inner join
customer.key on co_customer.column = s22.database.dbo.table.column
I have tried this with [] and without Sql 2008 R2 Enterprise
Any Thoughts
May 25, 2011 at 8:30 am
It sounds like you have a typo on your syntax.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
May 25, 2011 at 8:34 am
Nope that's not the problem. I have tried the
select top 10 from s22.database.dbo.table and got results but then I tried to join a database on the second server will call it s23 it doen't work
I am running the query on S23 (which is a SQL 2008 R2 Enterprise box) and the s22 linked server is a (SQL 2005 Standard server.
Any other thoughts?
May 25, 2011 at 8:43 am
You may want to provide some additional information.
Try using an alias on each table and each column?
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
May 25, 2011 at 8:43 am
Use an alias on each table that you are joining?
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
May 25, 2011 at 8:45 am
Please Try below
select
customer.key,
A.column
from s22.database.dbo.table A
inner join
customer.key on co_customer.column = A.column
May 25, 2011 at 8:47 am
select
B.key,
A.column
from s22.database.dbo.table A
inner join
customer B on B.column = A.column
May 25, 2011 at 8:47 am
not using any alias's
Here is the exact query
select top 10 * from s22.gcsaa.dbo.tblMemberTrack (This works just fine on s23 querying linked server db on s22
This one give the error message. Doesn't matter if I have [dbo].[co_customer] in [] or not
select top 10 *
from [s22].[aascg].[dbo].[tblMemberTrack]
inner join
co_customer on co_customer.cst_recno = [s22].[aascg].[dbo].[tblMTrack].[ConstitID]
May 25, 2011 at 8:50 am
Where is the second table that you are Joining on?
You need to add an alias to each column.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply