Home Forums SQL Server 2005 T-SQL (SS2K5) cannot insert duplicate key row in object 'tablename' with unique index 'indexname' RE: cannot insert duplicate key row in object 'tablename' with unique index 'indexname'

  • 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?

    Thank You