Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

multipart identifier could not bound Expand / Collapse
Author
Message
Posted Wednesday, July 10, 2013 7:32 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, November 4, 2013 8:13 AM
Points: 190, Visits: 367
hi

i have query like this

select ra.column, r1,column2

from emp ra inner join
emp1 r1
on r1.empid = ra.empid

.

i need to add 1more field from emp1. but when i am trying getting error like 'The multi-part identifier "r1.emp2" could not be bound.'
Post #1472126
Posted Wednesday, July 10, 2013 7:53 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, June 27, 2014 8:03 AM
Points: 320, Visits: 1,079
Is your real query more complicated than this?

If so, the table alias you're using could be out of scope.

If you post the query we can take a look at it.
Post #1472151
Posted Wednesday, July 10, 2013 7:59 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:27 AM
Points: 1,890, Visits: 2,329
can you please post your actual query so that we can look into that


_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1472160
Posted Wednesday, July 10, 2013 8:13 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, November 4, 2013 8:13 AM
Points: 190, Visits: 367
select distinct rl.Id,
rl.AlarmId, rl.Name




From T.dbo.BHI_Alarm ra with (nolock)
Inner Join T.dbo.BHI_Library rl with (nolock)
On rl.id = ra.id
and rl.BatchId = ra.BatchId
and rl.nameid = @nameid
and rl.AId = @AId

and (ra.memberid = @memberid or ra.CustomerId = @cid)
Post #1472171
Posted Wednesday, July 10, 2013 8:17 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:30 AM
Points: 13,443, Visits: 12,305
riya_dave (7/10/2013)
select distinct rl.Id,
rl.AlarmId, rl.Name




From T.dbo.BHI_Alarm ra with (nolock)
Inner Join T.dbo.BHI_Library rl with (nolock)
On rl.id = ra.id
and rl.BatchId = ra.BatchId
and rl.nameid = @nameid
and rl.AId = @AId

and (ra.memberid = @memberid or ra.CustomerId = @cid)


Can you share some details? What are trying to add to your query? What do the tables look like?

And be careful with using the NOLOCK hint. Do you know what that hint brings to the table? http://sqlblogcasts.com/blogs/tonyrogerson/archive/2006/11/10/1280.aspx


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1472177
Posted Wednesday, July 10, 2013 9:44 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 7:33 AM
Points: 2,851, Visits: 5,101

i need to add 1more field from emp1. but when i am trying getting error like 'The multi-part identifier "r1.emp2" could not be bound.'


The above means that there is no column named "emp2" in a table/view/subquery/anything else referenced by the alias "r1"


_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!"
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Post #1472217
Posted Wednesday, July 10, 2013 9:51 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, November 4, 2013 8:13 AM
Points: 190, Visits: 367
i can see that column name in my table.

also when i type alias my intellisense for that table doesnt get anything, if i type anoter table name
it display all the fields for that table?
Post #1472223
Posted Wednesday, July 10, 2013 9:59 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 7:33 AM
Points: 2,851, Visits: 5,101
riya_dave (7/10/2013)
i can see that column name in my table.

also when i type alias my intellisense for that table doesnt get anything, if i type anoter table name
it display all the fields for that table?


You need to post accuratly complete query you're written.
The one posted:
select ra.column, r1,column2

from emp ra inner join
emp1 r1
on r1.empid = ra.empid


has a comma instead of dot between "r1" and "column2" in a select line, which would cause another errorr.
Can you also post DDL for your "emp" and "emp1" tables


_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!"
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Post #1472227
Posted Wednesday, July 10, 2013 10:01 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 6:11 AM
Points: 3,637, Visits: 7,936
Are you checking on the same server and database? (it has happened to me more than once)
Are you sure the spelling of the alias is correct?
Have you refreshed the Intellisense local cache?



Luis C.
Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1472229
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse