471,073 Members | 1,390 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,073 software developers and data experts.

What's wrong with this View? Duplicate columns?

When I add this code in a view and try to save . . .

SELECT TOP 610 *
FROM dbo.Master INNER JOIN
dbo.TypeByCase ON dbo.TypeByCase.CaseNum = dbo.Master.CaseNum

It gives the error:
ODBC error: [Microsoft][ODBC SQL Server Driver]Column names in each
view or function must be unique. Column name 'CaseNum' in view or
function 'dbo.BobView1' is specified more than once.

Any idea why?

Thanks,

RBollinger

Jul 23 '05 #1
1 4329
robboll (ro*****@hotmail.com) writes:
When I add this code in a view and try to save . . .

SELECT TOP 610 *
FROM dbo.Master INNER JOIN
dbo.TypeByCase ON dbo.TypeByCase.CaseNum = dbo.Master.CaseNum

It gives the error:
ODBC error: [Microsoft][ODBC SQL Server Driver]Column names in each
view or function must be unique. Column name 'CaseNum' in view or
function 'dbo.BobView1' is specified more than once.

Any idea why?


The error message appears to be crystal clear to me. You have a column
CaseNum in both tables, and you cannot have the same column twice in a
query.

I am sorry, but if this answer does not help you, I will have to ask
you to:
o Post the CREATE TABLE statement for the tables in question.
o The CREATE VIEW statement you are using.
o Why you think this should work.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by belton180 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.