Link to home
Start Free TrialLog in
Avatar of sdc248
sdc248Flag for United States of America

asked on

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.
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sdc248

ASKER

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.