-
UNIQUE INDEX if not NULL
Hello !
for MS SQL 2000
how can i set an unique index on Serial column but only if Serial IS NOT NULL
CREATE UNIQUE INDEX [IX_Product] ON [Product]([Serial]) ON [PRIMARY]
i can have 100 rows with a NULL Serial
thank you
-
Don't really understand your question. You can only create unique index on column that doesn't allow null.
-
but i need a column allowing NULL, and if the value IS NOT NULL it must be UNIQUE
-
Can't do it with unique index, may need trigger to enforce that.
-
thank you, i shall do it from outside (.NET)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|