2015-04-24 12 views

Odpowiedz

12

Można ustawić check constraint:

constraint [check_abc] check (([A] is null and [B] is null and [C] is null) or 
           ([A] is not null and [B] is not null and [C] is not null)) 
1

Można też rozważyć faktoring te związane z kolumny do drugiej tabeli, w której są deklarowanej not null i tylko wstawiania wiersza mają one zastosowanie.

create table dbo.Table1( 
    Id int not null primary key 
) 


create table dbo.Table2( 
    Id int not null primary key references Table1, 
    A int not null, 
    B int not null, 
    C nvarchar (4000) not null 
) 
Powiązane problemy