看来ms sql server if 中定义个变量出了if 还是可以用的 if 1=1 begin declare @abc int; set @abc = 1 end print @abc 可以打出1出来