Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I am having some trouble creating a view on my database

If i run the query in a normal window the query runs returns all the data i require

When i copy that query to create a view i keep getting this error
multi-part identifier cannot be bound


could some one please explain to me what the issue could be and a possible solution.

Thanks in Advance
Posted
Comments
Zoltán Zörgő 11-Mar-13 4:11am    
Read this first: http://aartemiou.blogspot.fr/2009/01/multi-part-identifier-could-not-be.html
gvprabu 11-Mar-13 4:51am    
Give your sample query, what u tried?
isi19 11-Mar-13 4:59am    
Hi

I have managed to solve the issue when creating the view because the statements are unioned they have similar links to tables and the ssms created the view and aliased the 2nd and 3rd etc join

so if my query was select id,code from (select test.id,test.codeid from test inner join test.code on code.id = test.codeid unionall select table2.id,table.codeid inner join table2.codeid on code.id = table2.codeid) AS D


the sub query changed to
select test.id,test.codeid from test inner join test.code on code.id = test.codeid unionall select table2.id,table.codeid inner join table2.codeid_1 on code.id = table2.codeid_1

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900