sdc248
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_MyVie w v
inner join myTable1 t1 on...
inner join myTable2 t2 on...
[after fully-qualifying the table]
select *
from [server1].DB1.dbo.vw_MyVie w v
inner join [CurrentServer].CurrentDB. dbo.myTabl e1 t1 on...
inner join [CurrentServer].CurrentDB. dbo.myTabl e2 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.
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_MyVie
inner join myTable1 t1 on...
inner join myTable2 t2 on...
[after fully-qualifying the table]
select *
from [server1].DB1.dbo.vw_MyVie
inner join [CurrentServer].CurrentDB.
inner join [CurrentServer].CurrentDB.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER