I'm trying to create the following check constraint.
(
[Href] IS NOT NULL AND
[ETag] IS NOT NULL AND
[UserName] IS NOT NULL AND
[Password] IS NOT NULL AND
[UID] IS NOT NULL
)
OR
(
[Href] IS NULL AND
[ETag] IS NULL AND
[UserName] IS NULL AND
[Password] IS NULL AND
[UID] IS NULL
)
I can save it and there are no errors. But SSMS removes both of the inner parentheses (such that there is only the opening parenthesis at the start and the closing parenthesis at the end).
This would seem to change the meaning entirely. I want either all of these columns to be null or none of them to be null. Is there a reason why SQL Server can't handle this?