Wrox Programmer Forums
|
BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio
This is the forum to discuss the Wrox book ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solution by Vincent Varallo; ISBN: 9780470396865
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 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 January 4th, 2010, 12:52 PM
Authorized User
 
Join Date: Nov 2009
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Updating-..Cannot insert duplicate key in object 'ENTRoleCapab

When trying to update the accessFlag for an exisiting ENTRoleCapability record, the following error displays.

Violation of UNIQUE KEY constraint 'IX_RoleCapability'. Cannot insert duplicate key in object 'ENTRoleCapability'.
The statement has been terminated.

I executed the ENTRoleCapabilityUpdate stored procedure directly..receiving the same error.

The table create SQL that I downLoaded would not compile unless I commented out all instances of the code below.

/* WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON),*/

The IX_RoleCapability has two constraints that contain this. I don't know this level of the SQL. I'm not sure how to compile the WITH statements successfully??

Last edited by [email protected]; January 5th, 2010 at 04:20 PM.. Reason: Chapter6RoleBasedSecurity.sql Syntax error ??
 
Old January 5th, 2010, 04:34 PM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default

The prob that you are running into is because IX_RoleCapability is a Key field used to link two tables together. So you should examine the linked tables.

Without looking at it I would guess it links to ENTRole and ENTCapability. Find the listed Ids for the table and adjust those first and this linking table last.
 
Old January 5th, 2010, 05:40 PM
Authorized User
 
Join Date: Nov 2009
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I verified the ENTRole , ENTRoleCapability and ENTCapability keys all matched...I then truncated the ENTRoleCapability table to ensure that
it would insert a single record. This worked.

When I then edited the accessFlag, the IX_RoleCapability failure error still gets thrown.

Do you have a Table create SQL that differs from what I list below???

I downloaded the Table create sql and was unable to compile the ENTRoleCapability table create...unless I commented out the
commented out all instances of the code below.

/* WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON),*/

The IX_RoleCapability has two constraints that contain this. I don't know this level of the SQL. I'm not sure how to compile the WITH statements successfully??





Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate entry '1' for key 1 romburak BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 February 9th, 2009 06:56 PM
Cannot insert duplicate key row in object 'dbo.mov alxGramma SQL Server 2005 4 April 15th, 2008 01:42 PM
cannot insert duplicate key row in object 'Table' skyline666 SQL Server 2005 0 April 15th, 2008 05:03 AM
Foreign key not updating with Primary key xavier1945 BOOK: Access 2003 VBA Programmer's Reference 2 July 4th, 2007 09:48 PM
Duplicate Primary Key donevco Access 7 January 18th, 2007 01:59 PM





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