Home Forums SQL Server 2005 T-SQL (SS2K5) Receiving duplicate key insert error with DISTINCT clause RE: Receiving duplicate key insert error with DISTINCT clause

  • When I try to run just your declare:

    (Declare @AbsTab table (org_id int, absr_id int, abs_id int, abs_date datetime primary key (absr_id, abs_id,abstab_id)))

    I get:

    Msg 1911, Level 16, State 1, Line 1

    Column name 'abstab_id' does not exist in the target table or view.

    Msg 1750, Level 16, State 0, Line 1

    Could not create constraint. See previous errors.

    I'm curious, one of the errors you got referred to 'dbo.@AbsTab'. Is that a "hard" table rather than a table variable?

    bc

    [font="Arial Narrow"]bc[/font]