Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

cannot insert duplicate key row in object 'tablename' with unique index 'indexname' Expand / Collapse
Author
Message
Posted Tuesday, April 28, 2009 11:59 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, July 27, 2011 6:55 AM
Points: 142, Visits: 448
venki (4/28/2009)
Hi,

I want to increase the column size in the table tblCostBuildUp.
I am trying to execute this DDL statement but I am getting the errors.
If I do it from SSMS then it prompts me the foreign key columns and seeking the permission from me. How can we do it from Query Analyzer?

ALTER TABLE [dbo].[tblCostBuildUp] 
ALTER COLUMN [CostWorkOrder] nvarchar(15)

errors:
Msg 5074, Level 16, State 8, Line 1
The object 'aaaaatkOrder'.
Msg 4922, Level 16, State 9, Line 1
ALTER TABLE ALTER COLUMN CostWorkOrder failed because one or more objects access this column.blCostBuildUp4_PK' is dependent on column 'CostWorkOrder'.
Msg 5074, Level 16, State 5, Line 1
The object 'FK_TimeCollection_tblCostBuildUp' is dependent on column 'CostWorkOrder'.
Msg 5074, Level 16, State 5, Line 1
The object 'FK_tblPurchaseOrder_tblCostBuildUp' is dependent on column 'CostWor




Please guide me yar. How to change the column size in query analyzer, not in SSMS?


Thanks a lot,
Venki
Post #706488
Posted Saturday, December 04, 2010 5:12 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, December 04, 2010 5:11 AM
Points: 1, Visits: 0
Cannot insert duplicate key row in object 'tablename' with unique index 'indexname' in sql means?
Post #1030259
Posted Tuesday, April 30, 2013 8:34 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 10:35 AM
Points: 304, Visits: 1,169
hope this helps
http://connect.microsoft.com/SQLServer/feedback/details/434632/#details


Aim to inspire rather than to teach.
SQL Server DBA
Post #1448067
Posted Tuesday, April 30, 2013 8:41 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 2:10 AM
Points: 6,745, Visits: 12,836
logicinside22 (4/30/2013)
hope this helps
http://connect.microsoft.com/SQLServer/feedback/details/434632/#details


Not really. The connect item refers to a bug which can only be observed if a very specific set of conditions are met.


“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Post #1448072
Posted Wednesday, May 01, 2013 8:41 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, April 07, 2014 7:35 AM
Points: 1,172, Visits: 2,413
VRT (4/28/2009)



Please guide me yar. How to change the column size in query analyzer, not in SSMS?


You can't alter a column that is part of the primary key or that is referenced as a foreign key by another table. You have to drop the primary key and foreign key(s) before you can alter the column.


Jason Wolfkill
Blog: SQLSouth
Twitter: @SQLSouth
Post #1448443
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse