Home  • Database • Microsoft SQL Server

Create a unique constraint that also allows nulls in MSSQL Server

SQL Server
CREATE UNIQUE NONCLUSTERED INDEX uni_lot_master_doc_ref
ON item_lot_master(doc_ref)
WHERE doc_ref IS NOT NULL;

Comments 0


Copyright © 2024. Powered by Intellect Software Ltd