【发布时间】:2013-05-16 08:22:37
【问题描述】:
我是存储过程的新手。
我在一个变量中获取列的值并使用 If 块检查它。
我的代码如下:
create proc billRet
as
BEGIN
DECLARE @amt float
set @amt=select amount from bill where Id='2425'
If (@amt>1100.50 )
Begin
select @amt
print 'Amount greater '+@amt;
END
Else
Begin
select @amt
print 'Amount Smaller'+@amt
END
END
Go
它在打印语句和@amt 变量的声明中显示错误。
请告诉我哪里出错了。
请帮帮我。
【问题讨论】:
-
请包含您收到的完整错误消息。
标签: sql sql-server-2005 stored-procedures