The multi-part identifier could not be bound error

Hi:

I am about to move some 30 stored procedures from one database to another. In order to do this I need to fully qualify the tables in the queries that are located in the current database. But after doing that some of the stored procedures stop working, either in the current database or in the destination database.

I am using SQL Server 2008 R2. The queries involved look like the following:
[before]
select *
from [server1].DB1.dbo.vw_MyView v
inner join myTable1 t1 on...
inner join myTable2 t2 on...

[after fully-qualifying the table]
select *
from [server1].DB1.dbo.vw_MyView v
inner join [CurrentServer].CurrentDB.dbo.myTable1 t1 on...
inner join [CurrentServer].CurrentDB.dbo.myTable2 t2 on...

Error messages:
Msg 8180, Level 16, State 1, Line 1
Statement(s) could not be prepared.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "Tbl1020.objectSk" could not be bound.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "Tbl1018.bbgcmd" could not be bound.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "Tbl1018.isin" could not be bound.
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "Tbl1018.sedol" could not be bound.

Please help. Thanks.
sdc248Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
>DB1.dbo.vw_MyView v
>The multi-part identifier "Tbl1020.objectSk" could not be bound.

The first line, MyView implies a view, not a table.
The second line, since I don't see objectSk anywhere in the question, perhaps you need to edit the view to fully qualify the table references inside it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sdc248Author Commented:
Sorry I didn't have chance to test out your suggestion. My team leader has decided to go for a work around approach. Thanks all the same.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.