【发布时间】:2011-05-31 00:04:01
【问题描述】:
我的存储过程接受两个参数
@EffectiveStartDate 日期时间
@EffectiveEndDate 日期时间
我这样写验证码:
IF(@EffectiveStartDate > @EffectiveEndDate)
BEGIN
RAISERROR ('SPName: InsertUpdateLiquidityDateRule: Start Date: %s cannot be greater than End Date %s',11,1,CAST(@EffectiveStartDate AS varchar(30)),CAST(@EffectiveEndDate AS varchar(30)));
RETURN -1
END
我可以知道我在这里做错了什么。
在编译我的 SProc 时,它引发了消息“CAST() 附近的语法不正确”
【问题讨论】:
标签: sql sql-server sql-server-2005 stored-procedures raiserror