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