开发者

Strange T-SQL if statement behaviour

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜