Reputation: 195
I need to set @Type = '0' if (LEN(@Token) < 65. How do I do that?
Upvotes: 0
Views: 218
Reputation: 13641
Remove the outer parentheses.
IF LEN(@Token) < 65 SET @Type = '0'
;
Example:
DECLARE @token VARCHAR(100);
DECLARE @Type VARCHAR(100) = '1';
SET @token = 'asdfasdfaf';
IF LEN(@Token) < 65 SET @Type = '0';
PRINT @Type;
Upvotes: 3