SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


multipart identifier could not bound


multipart identifier could not bound

Author
Message
riya_dave
riya_dave
SSC Veteran
SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)

Group: General Forum Members
Points: 246 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.'
laurie-789651
laurie-789651
SSChasing Mays
SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)SSChasing Mays (618 reputation)

Group: General Forum Members
Points: 618 Visits: 1272
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.
kapil_kk
kapil_kk
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3105 Visits: 2766
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/
riya_dave
riya_dave
SSC Veteran
SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)

Group: General Forum Members
Points: 246 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)
Sean Lange
Sean Lange
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26323 Visits: 17553
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 Modens 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)
Eugene Elutin
Eugene Elutin
SSCertifiable
SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)

Group: General Forum Members
Points: 5040 Visits: 5478

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!":-D
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
riya_dave
riya_dave
SSC Veteran
SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)

Group: General Forum Members
Points: 246 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?
Eugene Elutin
Eugene Elutin
SSCertifiable
SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)

Group: General Forum Members
Points: 5040 Visits: 5478
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!":-D
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Luis Cazares
Luis Cazares
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16715 Visits: 19109
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.
General Disclaimer:
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?


How to post data/code on a forum to get the best help: Option 1 / Option 2
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search