Subject Re: Adding a primary key
Author alex_vnru
--- In ib-support@y..., "chlorox95" <chlorox95@y...> wrote:
> I can not add a primary key to one of my tables. I am using
Interbase
> Workbench and the constraint editor. It gives me an error like:
> Attempt to
> store duplicate value. (Visible to active transactions) in unique
> index
> RDB$PRIMARY19
>
> What???
>
Jim, PK can be created only on columns not containing nulls and
have not duplicated values. Check

Select * from YourTable
Where ID Is Null

(I assume ID is name of column for PK)

and

Select ID, Count(*)
From YourTable
Group By ID
Having Count(*)>1

Best regards, Alexander V.Nevsky.