Wrox Programmer Forums
|
BOOK: Wrox's SQL Server 2005 Express Edition Starter Kit ISBN: 978-0-7645-8923-2
This is the forum to discuss the Wrox book Wrox's SQL Server 2005 Express Edition Starter Kit by Rajesh George, Lance Delano; ISBN: 9780764589232
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Wrox's SQL Server 2005 Express Edition Starter Kit ISBN: 978-0-7645-8923-2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 7th, 2006, 10:56 PM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.




 
Old May 15th, 2006, 02:53 PM
Authorized User
 
Join Date: Nov 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi davwein,

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.
Thanks,
Scott Chang



Scott Chang
 
Old August 21st, 2010, 02:39 PM
Registered User
 
Join Date: Aug 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent - Send mail with plain view and html view ashish.dadhwal ASP.NET 2.0 Professional 0 November 27th, 2008 01:49 AM
any idea to view xml as it is but in hieratic view seco XSLT 2 January 17th, 2008 08:49 AM
Help Grid View Drop Down List, view all jskinner123 ASP.NET 2.0 Basics 0 November 25th, 2007 06:25 PM
Login View and Failed User Name timeware ASP.NET 2.0 Professional 7 June 22nd, 2007 09:19 AM
populate details view or list view non empty rows iinfoque ASP.NET 2.0 Basics 0 March 11th, 2007 06:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.