View example failed
When I attempted to try the view example on page 41
using this code:
CREATE VIEW InventoryPublisherView AS
(SELECT * FROM Inventory AS I FULL OUTER JOIN Publisher AS P ON I.ID=P.InventoryID)
I received the following error:
Msg 4506, Level 16, State 1, Procedure IPV, Line 2
Column names in each view or function must be unique. Column name 'ID' in view or function 'IPV' is specified more than once.
I tried using only the code part (in the brackets) - not the view part and the code worked ok. so I am confused as to what went wrong in the view specification.
The code statements of Using Views on Page 41 do not work in my Windows XP Pro PC that is on Microsoft Windows NT 4 LAN Syste. I got the following error messages in Parse or Execute without Results:
Msg 156, Level 15, State 1, Procedure InventoryPublisherView, Line 3
Incorrect syntax near the keyword 'SELECT'.
Msg 111, Level 15, State 1, Procedure InventoryPublisherView, Line 6
'ALTER VIEW' must be the first statement in a query batch.
I want to try your modified code statements (that worked in your PC/system - what kind of your PC and LAN System did yopu use?)in my PC. Please post your complete modified code statements on this Forum.
Try it out p41
This thread looks ancient, but I'll post in case anyone else has the same problem.
I'm running SSMSE 2005 on XP SP3.
davewein received this error message because the tables created earlier, 'Inventory' and 'Publisher' BOTH have columns, defined as primary keys, with the same name, "ID".
One just needs to delete either table and recreate them with differing column names. Once I did this, the queries completed successfully.
Hope this helps
|All times are GMT -4. The time now is 04:21 AM.|
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.