sql语句中begin end的作用

create procedure pro_calc 
@num int
as
if @num<3
begin
 print '小于3'
 print 'sss'
end
else
begin
 print '大于等于3'
 print 'fdf'
end

这个存储过程,一定要有begin 和end,因为if后面有两条语句要处理,相当于c#里的花括号一样。


猜你喜欢

转载自blog.csdn.net/hhw199112/article/details/79638494