Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
一意の列を定義したいのですが、null でない場合のみです。
つまり、複数の null 値が存在する可能性がありますが、null でない場合は異なる必要があります。これどうやってするの?
SQL Server 2008 以降では、インデックスに条件を指定できます
CREATE UNIQUE NONCLUSTERED INDEX IX_Filtered_Index_Name ON your_table (some_column) WHERE some_column IS NOT NULL