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.
Microsoft SQL Server 2008

Avatar of undefined
Last Comment
sdc248
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of sdc248
sdc248
Flag of United States of America image

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.
Microsoft SQL Server 2008
Microsoft SQL Server 2008

Microsoft SQL Server 2008 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. Major improvements include the Always On technologies and support for unstructured data types.

50K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo