UPDATE statement conflicted with COLUMN REFERENCE constraint

  • getting this error try to modify one field in a table

    [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]UPDATE statement conflicted with COLUMN REFERENCE constraint 'eq_em_id'. The conflict occurred in database 'KOC151', table 'eq', column 'em_id'.

    This worked until last week. checked for corruption in the DB and there is none.

    This is an application that security uses to keep track of employees information. They cannot modify someones name.

    can anyone help troubleshoot?

    here is the table DDL:

    CREATE TABLE [dbo].[eq] (

    [bl_id] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [comments] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [condition] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [cost_dep_value] [numeric](10, 2) NOT NULL ,

    [cost_purchase] [numeric](10, 2) NOT NULL ,

    [cost_replace] [numeric](10, 2) NOT NULL ,

    [criticality] [smallint] NOT NULL ,

    [csi_id] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [date_in_repair] [datetime] NULL ,

    [date_in_service] [datetime] NULL ,

    [date_in_storage] [datetime] NULL ,

    [date_installed] [datetime] NULL ,

    [date_manufactured] [datetime] NULL ,

    [date_of_stat_chg] [datetime] NULL ,

    [date_purchased] [datetime] NULL ,

    [date_salvaged] [datetime] NULL ,

    [date_sold] [datetime] NULL ,

    [dp_id] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [dv_id] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [dwgname] [char] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [ehandle] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [em_id] [char] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [eq_std] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [fl_id] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [hardware_address] [char] (24) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [image_eq_assy] [char] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [image_eq_elec] [char] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [image_eq_lub] [char] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [image_spec] [char] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [is_multiplexing] [smallint] NOT NULL ,

    [layer_name] [char] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [limit_alarm_high] [numeric](12, 3) NOT NULL ,

    [limit_alarm_low] [numeric](12, 3) NOT NULL ,

    [limit_ctl_high] [numeric](12, 3) NOT NULL ,

    [limit_ctl_low] [numeric](12, 3) NOT NULL ,

    [loc_bay] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [loc_column] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [loc_maint_manl] [char] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [locked_out] [smallint] NOT NULL ,

    [meter] [numeric](12, 2) NOT NULL ,

    [meter_last_read] [datetime] NULL ,

    [meter_units] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [meter_usage_per_day] [numeric](8, 2) NOT NULL ,

    [net_address] [char] (24) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [net_address_ip] [char] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [net_card_type] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [net_id] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [net_node_name] [char] (24) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [net_sub_mask] [char] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [num_lease] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [num_po] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [num_serial] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [option1] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [option2] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [os_type] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [po_id] [int] NULL ,

    [po_line_id] [int] NULL ,

    [policy_id] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [pr_id] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [property_type] [char] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [qty_dep_period] [numeric](6, 2) NOT NULL ,

    [qty_hrs_run_day] [numeric](5, 2) NOT NULL ,

    [qty_life_expct] [smallint] NOT NULL ,

    [qty_MTBF] [numeric](9, 2) NOT NULL ,

    [qty_MTTR] [numeric](9, 2) NOT NULL ,

    [qty_pms] [smallint] NOT NULL ,

    [rack_id] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [recovery_status] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,

    [rm_id] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [salvaged] [smallint] NOT NULL ,

    [servcont_id] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [site_id] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [status] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [subcomponent_of] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [survey_id] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [ta_lease_id] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [tagged_out] [smallint] NOT NULL ,

    [tc_area_level] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [tc_client_server] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [tc_level] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [tc_service] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [use1] [char] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [value_salvage] [numeric](10, 2) NOT NULL ,

    [vn_id] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [warranty_id] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [eq_id] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,

    [koc_id] [char] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [lease_own] [char] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [lease_rent] [numeric](10, 2) NULL ,

    [maint_agree] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [maint_date] [datetime] NULL ,

    [mfr] [char] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [modelno] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [mv_date_received] [datetime] NULL ,

    [mv_po_number] [char] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [mv_received_by] [char] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [spec_depth] [float] NOT NULL ,

    [spec_height] [float] NOT NULL ,

    [spec_width] [float] NOT NULL ,

    [time_stamp] [char] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [username] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [category] [char] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

    [Description1] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL

    ) ON [PRIMARY]

    GO

    ALTER TABLE [dbo].[eq] ADD

    CONSTRAINT [DF__eq__bl_id__7AC720C5] DEFAULT (null) FOR [bl_id],

    CONSTRAINT [DF__eq__comments__7BBB44FE] DEFAULT (null) FOR [comments],

    CONSTRAINT [DF__eq__condition__7CAF6937] DEFAULT ('new') FOR [condition],

    CONSTRAINT [DF__eq__cost_dep_val__7DA38D70] DEFAULT (0) FOR [cost_dep_value],

    CONSTRAINT [DF__eq__cost_purchas__7E97B1A9] DEFAULT (0) FOR [cost_purchase],

    CONSTRAINT [DF__eq__cost_replace__7F8BD5E2] DEFAULT (0) FOR [cost_replace],

    CONSTRAINT [DF__eq__criticality__007FFA1B] DEFAULT (0) FOR [criticality],

    CONSTRAINT [DF__eq__csi_id__01741E54] DEFAULT (null) FOR [csi_id],

    CONSTRAINT [DF__eq__date_in_repa__0268428D] DEFAULT (null) FOR [date_in_repair],

    CONSTRAINT [DF__eq__date_in_serv__035C66C6] DEFAULT (null) FOR [date_in_service],

    CONSTRAINT [DF__eq__date_in_stor__04508AFF] DEFAULT (null) FOR [date_in_storage],

    CONSTRAINT [DF__eq__date_install__0544AF38] DEFAULT (null) FOR [date_installed],

    CONSTRAINT [DF__eq__date_manufac__0638D371] DEFAULT (null) FOR [date_manufactured],

    CONSTRAINT [DF__eq__date_of_stat__072CF7AA] DEFAULT (null) FOR [date_of_stat_chg],

    CONSTRAINT [DF__eq__date_purchas__08211BE3] DEFAULT (null) FOR [date_purchased],

    CONSTRAINT [DF__eq__date_salvage__0915401C] DEFAULT (null) FOR [date_salvaged],

    CONSTRAINT [DF__eq__date_sold__0A096455] DEFAULT (null) FOR [date_sold],

    CONSTRAINT [DF__eq__dp_id__0AFD888E] DEFAULT (null) FOR [dp_id],

    CONSTRAINT [DF__eq__dv_id__0BF1ACC7] DEFAULT (null) FOR [dv_id],

    CONSTRAINT [DF__eq__dwgname__0CE5D100] DEFAULT (null) FOR [dwgname],

    CONSTRAINT [DF__eq__ehandle__0DD9F539] DEFAULT (null) FOR [ehandle],

    CONSTRAINT [DF__eq__em_id__0ECE1972] DEFAULT (null) FOR [em_id],

    CONSTRAINT [DF__eq__eq_std__0FC23DAB] DEFAULT (null) FOR [eq_std],

    CONSTRAINT [DF__eq__fl_id__10B661E4] DEFAULT (null) FOR [fl_id],

    CONSTRAINT [DF__eq__hardware_add__11AA861D] DEFAULT (null) FOR [hardware_address],

    CONSTRAINT [DF__eq__image_eq_ass__129EAA56] DEFAULT (null) FOR [image_eq_assy],

    CONSTRAINT [DF__eq__image_eq_ele__1392CE8F] DEFAULT (null) FOR [image_eq_elec],

    CONSTRAINT [DF__eq__image_eq_lub__1486F2C8] DEFAULT (null) FOR [image_eq_lub],

    CONSTRAINT [DF__eq__image_spec__157B1701] DEFAULT (null) FOR [image_spec],

    CONSTRAINT [DF__eq__is_multiplex__166F3B3A] DEFAULT (0) FOR [is_multiplexing],

    CONSTRAINT [DF__eq__layer_name__17635F73] DEFAULT (null) FOR [layer_name],

    CONSTRAINT [DF__eq__limit_alarm___185783AC] DEFAULT (0) FOR [limit_alarm_high],

    CONSTRAINT [DF__eq__limit_alarm___194BA7E5] DEFAULT (0) FOR [limit_alarm_low],

    CONSTRAINT [DF__eq__limit_ctl_hi__1A3FCC1E] DEFAULT (0) FOR [limit_ctl_high],

    CONSTRAINT [DF__eq__limit_ctl_lo__1B33F057] DEFAULT (0) FOR [limit_ctl_low],

    CONSTRAINT [DF__eq__loc_bay__1C281490] DEFAULT (null) FOR [loc_bay],

    CONSTRAINT [DF__eq__loc_column__1D1C38C9] DEFAULT (null) FOR [loc_column],

    CONSTRAINT [DF__eq__loc_maint_ma__1E105D02] DEFAULT (null) FOR [loc_maint_manl],

    CONSTRAINT [DF__eq__locked_out__1F04813B] DEFAULT (0) FOR [locked_out],

    CONSTRAINT [DF__eq__meter__1FF8A574] DEFAULT (0) FOR [meter],

    CONSTRAINT [DF__eq__meter_last_r__20ECC9AD] DEFAULT (null) FOR [meter_last_read],

    CONSTRAINT [DF__eq__meter_units__21E0EDE6] DEFAULT ('hour') FOR [meter_units],

    CONSTRAINT [DF__eq__meter_usage___22D5121F] DEFAULT (0) FOR [meter_usage_per_day],

    CONSTRAINT [DF__eq__net_address__23C93658] DEFAULT (null) FOR [net_address],

    CONSTRAINT [DF__eq__net_address___24BD5A91] DEFAULT (null) FOR [net_address_ip],

    CONSTRAINT [DF__eq__net_card_typ__25B17ECA] DEFAULT (null) FOR [net_card_type],

    CONSTRAINT [DF__eq__net_id__26A5A303] DEFAULT (null) FOR [net_id],

    CONSTRAINT [DF__eq__net_node_nam__2799C73C] DEFAULT (null) FOR [net_node_name],

    CONSTRAINT [DF__eq__net_sub_mask__288DEB75] DEFAULT (null) FOR [net_sub_mask],

    CONSTRAINT [DF__eq__num_lease__29820FAE] DEFAULT (null) FOR [num_lease],

    CONSTRAINT [DF__eq__num_po__2A7633E7] DEFAULT (null) FOR [num_po],

    CONSTRAINT [DF_eq_num_serial_default] DEFAULT (null) FOR [num_serial],

    CONSTRAINT [DF__eq__option1__2C5E7C59] DEFAULT (null) FOR [option1],

    CONSTRAINT [DF__eq__option2__2D52A092] DEFAULT (null) FOR [option2],

    CONSTRAINT [DF__eq__os_type__2E46C4CB] DEFAULT (null) FOR [os_type],

    CONSTRAINT [DF__eq__po_id__2F3AE904] DEFAULT (null) FOR [po_id],

    CONSTRAINT [DF__eq__po_line_id__302F0D3D] DEFAULT (null) FOR [po_line_id],

    CONSTRAINT [DF__eq__policy_id__31233176] DEFAULT (null) FOR [policy_id],

    CONSTRAINT [DF__eq__pr_id__321755AF] DEFAULT (null) FOR [pr_id],

    CONSTRAINT [DF__eq__property_typ__330B79E8] DEFAULT (null) FOR [property_type],

    CONSTRAINT [DF__eq__qty_dep_peri__33FF9E21] DEFAULT (0) FOR [qty_dep_period],

    CONSTRAINT [DF__eq__qty_hrs_run___34F3C25A] DEFAULT (0.0) FOR [qty_hrs_run_day],

    CONSTRAINT [DF__eq__qty_life_exp__35E7E693] DEFAULT (0) FOR [qty_life_expct],

    CONSTRAINT [DF__eq__qty_MTBF__36DC0ACC] DEFAULT (0) FOR [qty_MTBF],

    CONSTRAINT [DF__eq__qty_MTTR__37D02F05] DEFAULT (0) FOR [qty_MTTR],

    CONSTRAINT [DF__eq__qty_pms__38C4533E] DEFAULT (0) FOR [qty_pms],

    CONSTRAINT [DF__eq__rack_id__39B87777] DEFAULT (null) FOR [rack_id],

    CONSTRAINT [DF__eq__recovery_sta__3AAC9BB0] DEFAULT ('NONE') FOR [recovery_status],

    CONSTRAINT [DF__eq__rm_id__3BA0BFE9] DEFAULT (null) FOR [rm_id],

    CONSTRAINT [DF__eq__salvaged__3C94E422] DEFAULT (0) FOR [salvaged],

    CONSTRAINT [DF__eq__servcont_id__3D89085B] DEFAULT (null) FOR [servcont_id],

    CONSTRAINT [DF__eq__site_id__3E7D2C94] DEFAULT (null) FOR [site_id],

    CONSTRAINT [DF__eq__status__3F7150CD] DEFAULT ('in') FOR [status],

    CONSTRAINT [DF__eq__subcomponent__40657506] DEFAULT (null) FOR [subcomponent_of],

    CONSTRAINT [DF__eq__survey_id__4159993F] DEFAULT (null) FOR [survey_id],

    CONSTRAINT [DF__eq__ta_lease_id__424DBD78] DEFAULT (null) FOR [ta_lease_id],

    CONSTRAINT [DF__eq__tagged_out__4341E1B1] DEFAULT (0) FOR [tagged_out],

    CONSTRAINT [DF__eq__tc_area_leve__443605EA] DEFAULT ('N/A') FOR [tc_area_level],

    CONSTRAINT [DF__eq__tc_client_se__452A2A23] DEFAULT ('N/A') FOR [tc_client_server],

    CONSTRAINT [DF__eq__tc_level__461E4E5C] DEFAULT (null) FOR [tc_level],

    CONSTRAINT [DF__eq__tc_service__47127295] DEFAULT ('N/A') FOR [tc_service],

    CONSTRAINT [DF__eq__use1__480696CE] DEFAULT (null) FOR [use1],

    CONSTRAINT [DF__eq__value_salvag__48FABB07] DEFAULT (0) FOR [value_salvage],

    CONSTRAINT [DF__eq__vn_id__49EEDF40] DEFAULT (null) FOR [vn_id],

    CONSTRAINT [DF__eq__warranty_id__4AE30379] DEFAULT (null) FOR [warranty_id],

    CONSTRAINT [DF__eq__eq_id__4BD727B2] DEFAULT (null) FOR [eq_id],

    CONSTRAINT [DF__eq__koc_id__122052C0] DEFAULT (null) FOR [koc_id],

    CONSTRAINT [DF__eq__lease_own__131476F9] DEFAULT ('OWNED') FOR [lease_own],

    CONSTRAINT [DF__eq__lease_rent__14089B32] DEFAULT (null) FOR [lease_rent],

    CONSTRAINT [DF__eq__maint_agree__14FCBF6B] DEFAULT ('N') FOR [maint_agree],

    CONSTRAINT [DF__eq__maint_date__15F0E3A4] DEFAULT (null) FOR [maint_date],

    CONSTRAINT [DF__eq__mfr__2AB6F660] DEFAULT (null) FOR [mfr],

    CONSTRAINT [DF__eq__modelno__2C9F3ED2] DEFAULT (null) FOR [modelno],

    CONSTRAINT [DF__eq__mv_date_rece__5BA511D5] DEFAULT (null) FOR [mv_date_received],

    CONSTRAINT [DF__eq__mv_po_number__5C99360E] DEFAULT (null) FOR [mv_po_number],

    CONSTRAINT [DF__eq__mv_received___5D8D5A47] DEFAULT (null) FOR [mv_received_by],

    CONSTRAINT [DF_eq_spec_depth_default] DEFAULT (0) FOR [spec_depth],

    CONSTRAINT [DF_eq_spec_height_default] DEFAULT (0) FOR [spec_height],

    CONSTRAINT [DF_eq_spec_width_default] DEFAULT (0) FOR [spec_width],

    CONSTRAINT [DF__eq__time_stamp__615DEB2B] DEFAULT (null) FOR [time_stamp],

    CONSTRAINT [DF__eq__username__62520F64] DEFAULT (null) FOR [username],

    CONSTRAINT [DF__eq__category__6346339D] DEFAULT (null) FOR [category],

    CONSTRAINT [DF__eq__Description1__643A57D6] DEFAULT (null) FOR [Description1],

    CONSTRAINT [eq_PK] PRIMARY KEY CLUSTERED

    (

    [eq_id]

    ) ON [PRIMARY]

    GO

    ALTER TABLE [dbo].[eq] ADD

    CONSTRAINT [eq_bl_id] FOREIGN KEY

    (

    [bl_id]

    ) REFERENCES [dbo].[bl] (

    [bl_id]

    ),

    CONSTRAINT [eq_csi_id] FOREIGN KEY

    (

    [csi_id]

    ) REFERENCES [dbo].[csi] (

    [csi_id]

    ),

    CONSTRAINT [eq_dp_id] FOREIGN KEY

    (

    [dv_id],

    [dp_id]

    ) REFERENCES [dbo].[dp] (

    [dv_id],

    [dp_id]

    ),

    CONSTRAINT [eq_dv_id] FOREIGN KEY

    (

    [dv_id]

    ) REFERENCES [dbo].[dv] (

    [dv_id]

    ),

    CONSTRAINT [eq_em_id] FOREIGN KEY

    (

    [em_id]

    ) REFERENCES [dbo]. (

    [em_id]

    ),

    CONSTRAINT [eq_eq_std] FOREIGN KEY

    (

    [eq_std]

    ) REFERENCES [dbo].[eqstd] (

    [eq_std]

    ),

    CONSTRAINT [eq_fl_id] FOREIGN KEY

    (

    [bl_id],

    [fl_id]

    ) REFERENCES [dbo].[fl] (

    [bl_id],

    [fl_id]

    ),

    CONSTRAINT [eq_net_id] FOREIGN KEY

    (

    [net_id]

    ) REFERENCES [dbo].[net] (

    [net_id]

    ),

    CONSTRAINT [eq_po_id] FOREIGN KEY

    (

    [po_id]

    ) REFERENCES [dbo].[po] (

    [po_id]

    ),

    CONSTRAINT [eq_po_line_id] FOREIGN KEY

    (

    [po_id],

    [po_line_id]

    ) REFERENCES [dbo].[po_line] (

    [po_id],

    [po_line_id]

    ),

    CONSTRAINT [eq_policy_id] FOREIGN KEY

    (

    [policy_id]

    ) REFERENCES [dbo].[policy] (

    [policy_id]

    ),

    CONSTRAINT [eq_pr_id] FOREIGN KEY

    (

    [pr_id]

    ) REFERENCES [dbo].[property] (

    [pr_id]

    ),

    CONSTRAINT [eq_property_type] FOREIGN KEY

    (

    [property_type]

    ) REFERENCES [dbo].[property_type] (

    [property_type]

    ),

    CONSTRAINT [eq_rack_id] FOREIGN KEY

    (

    [bl_id],

    [fl_id],

    [rm_id],

    [rack_id]

    ) REFERENCES [dbo].[rack] (

    [bl_id],

    [fl_id],

    [rm_id],

    [rack_id]

    ),

    CONSTRAINT [eq_rm_id] FOREIGN KEY

    (

    [bl_id],

    [fl_id],

    [rm_id]

    ) REFERENCES [dbo].[rm] (

    [bl_id],

    [fl_id],

    [rm_id]

    ),

    CONSTRAINT [eq_servcont_id] FOREIGN KEY

    (

    [servcont_id]

    ) REFERENCES [dbo].[servcont] (

    [servcont_id]

    ),

    CONSTRAINT [eq_site_id] FOREIGN KEY

    (

    [site_id]

    ) REFERENCES [dbo].[site] (

    [site_id]

    ),

    CONSTRAINT [eq_survey_id] FOREIGN KEY

    (

    [survey_id]

    ) REFERENCES [dbo].[survey] (

    [survey_id]

    ),

    CONSTRAINT [eq_ta_lease_id] FOREIGN KEY

    (

    [ta_lease_id]

    ) REFERENCES [dbo].[ta_lease] (

    [ta_lease_id]

    ),

    CONSTRAINT [eq_tc_level] FOREIGN KEY

    (

    [tc_level]

    ) REFERENCES [dbo].[afm_tclevel] (

    [tc_level]

    ),

    CONSTRAINT [eq_vn_id] FOREIGN KEY

    (

    [vn_id]

    ) REFERENCES [dbo].[vn] (

    [vn_id]

    ),

    CONSTRAINT [eq_warranty_id] FOREIGN KEY

    (

    [warranty_id]

    ) REFERENCES [dbo].[warranty] (

    [warranty_id]

    )

    GO

  • Which field are trying to modify?

    * CONSTRAINT [eq_em_id] FOREIGN KEY

    (

    [em_id]

    ) REFERENCES [dbo]. (

    [em_id]

    )

    *Was the constraint created with nocheck?

  • I think the application is trying to modify the em_id field which contains employee names. It does not look like the constraint was created with 'no check' what implications would that have?

  • Well - the error message is implying that whatever the new value for em_ID is. - it doesn't exist in the employee table. Meaning - the employeeID doesn't exist yet, or doesn't exist anymore.

    Have you tried checking out profiler to verify what is being sent?

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Profiler....

    declare @P1 int

    set @P1=-1

    declare @P2 int

    set @P2=0

    declare @P3 int

    set @P3=1

    declare @P4 int

    set @P4=8196

    declare @P5 int

    set @P5=0

    exec sp_cursorprepexec @P1 output, @P2 output, NULL, N'SELECT em_id,em_std FROM em ORDER BY em_id', @P3 output, @P4 output, @P5 output

    select @P1, @P2, @P3, @P4, @P5

    and

    SELECT em_id,em_std FROM em ORDER BY em_id

  • That's a SELECT. The message is about an UPDATE operation. You don't think you're looking at the right operation.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • i set up profiler to pick up everthing.. aside from all the selects.. i'm just seeing lots of these..

    exec sp_cursorfetch 180151353, 2, 1, 1

    Did I set up profiler wrong?

  • No - it sounds like profiler is fine - you just have to find which row actually talks about the UPDATE operation you're trying to perform. Might not be the last one at all. None of the items you're shown so far seem to be the relevant one.

    You should be able to issue a "find" command, and find all of the UPDATE commands. Find the relevant want, so you can check out what the value was it was trying to send in.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • did not find an update statement.. lock aquired, lock released.. over and over again

  • definitely a learning experience After looking at the sql profiler trace again I see what's happening.

    The conflict occurs because of the column constraint. It can't update EM_ID in the EQ table because it references the EM_ID in the EM table which is the Primary Key for that table. Both EM_ID columns contain employee names.

    Badly designed App.. and DB 🙂

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply