This is my statement
IF (@UserName IS NULL AND @EditorKey IS NULL) OR (@UserName IS NOT NULL AND @EditorKey IS NOT NULL) BEGIN
RAISERROR ('One of @UserName, @EditorKey must be non-null.', 15, 0)
RETURN
END
What I want is to be able to do something like this:
IF (@UserName IS NOT NULL) XOR (@EditorKey IS NOT NULL) BEGIN
RAISERROR ('One of @UserName, @EditorKey must be non-null.', 15, 0)
RETURN
END
For two parameters it isn't that big of a deal, but some procs have three or four where in only one may be passed and the rest should be null.