'MOD' is not a recognized built-in function name
In TSQL, the modulo is done with a percent sign.
SELECT 38 % 5 would give you the modulo 3
for your exact sample, it should be like this.
DECLARE @m INT
SET @m = 321%11
SELECT @m
The MOD
keyword only exists in the DAX
language (tabular dimensional queries), not TSQL
Use %
instead.
Ref: Modulo