标题:新手求助,存储过程,“错误 156 :在关键字‘ end ’附近有语法错误”
只看楼主
踩不扁小强
Rank: 2
等 级:论坛游民
帖 子:46
专家分:39
注 册:2013-4-6
结帖率:91.67%
已结贴  问题点数:20 回复次数:2 
新手求助,存储过程,“错误 156 :在关键字‘ end ’附近有语法错误”
create procedure proc_calculate_taxes
(
 @FromDate datetime,
 @ToDate datetime,
 @XzqId int,
 @StaticCol int,
 @StaticWay int,
 @Result varchar(255) output
)
as
   begin
            select @Result=sum(TB1.ZDBCZE) from TB1,TB2
            where (TB1.CreateTime < @ToDate and TB1.CreateTime >= @FromDate)
                and TB1.XmjlId = TB2.ID
                and
                 (TB2.XzqId IN
                 (SELECT ID
                   FROM TB3
                   WHERE
                   (TB3.Path LIKE '%,'+@XzqId+',%'))
    end
搜索更多相关主题的帖子: procedure 关键字 create where 
2014-10-08 16:12
mxbing1984
Rank: 7Rank: 7Rank: 7
来 自:贵州道真
等 级:贵宾
威 望:37
帖 子:73
专家分:342
注 册:2014-8-8
得分:20 
create procedure proc_calculate_taxes
(
@FromDate datetime,
@ToDate datetime,
@XzqId int,
@StaticCol int,
@StaticWay int,
@Result varchar(255) output
)
as
   begin
            select @Result=sum(TB1.ZDBCZE) from TB1,TB2
            where TB1.CreateTime < @ToDate and TB1.CreateTime >= @FromDate
                and TB1.XmjlId = TB2.ID
                and
                 TB2.XzqId IN
                 (SELECT ID
                   FROM TB3
                   WHERE
                    TB3.Path LIKE '%,'+@XzqId+',%')
    end

天再高,踮起脚尖就能更接近阳光
2014-10-09 08:26
踩不扁小强
Rank: 2
等 级:论坛游民
帖 子:46
专家分:39
注 册:2013-4-6
得分:0 
回复 2 楼 mxbing1984
原来是漏了个括号,我太粗心了,谢了啊。
2014-10-09 10:07



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-436972-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.242455 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved