I have the following T-SQL if statement:
if @changeType = 'ChangeFrom'
begin
print 'yep'
end
else
begin
print 'nope'
end
If @changeType = 'ChangeFrom' I get yep.
If @changeType = 'ChangeTo' I get nope.
If @changeType ='ChangeFromfsjkfh' I get yep! Whats going on there?
What length have you declared the @ChangeType variable as – it looks like it’s getting truncated?