I have a message error
Invalid int argument data type for substring function argument 1.
I don't understand why!
UPDATE DBO.NUMBER
SET NUMBER = 22675442455
WHERE SUBSTRING(ID,1,2) NOT IN ('67','68')
CodePudding user response:
SUBSTRING
required first argument as STRING
, so simply convert it to VARCHAR
.
UPDATE DBO.NUMBER
SET NUMBER = 22675442455
WHERE SUBSTRING(CONVERT(VARCHAR(15),ID)),1,2) NOT IN ('67','68')