错误 SQL70001:在此上下文中无法识别此语句 [英] Error SQL70001: This statement is not recognized in this context

查看:57
本文介绍了错误 SQL70001:在此上下文中无法识别此语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 asp.net 应用程序中有如下存储过程:

I have stored procedure in asp.net application as following:

CREATE PROCEDURE [dbo].[step2-e]
    @PI varchar(50),
    @Balance int output ,
    @Shipment_status varchar(50) output,
    @ETA varchar(50) output,
    @Forwarder varchar(50) output,
    @Transit_time Time output,
    @Shipping_date date output,
    @Shipping_method varchar(50) output,
    @Clearance_location varchar(50) output,
    @Advance_payment varchar(50) output 
    @Balance_t varchar(50) output,
    @Loading_date date output 
    @Balance_d date output
AS
Begin
   select 
       @Advance_payment = [advance_payment] @Balance = [Balance], 
       @Shipment_status = [Shipment_status],
       @ETA = [Eta], @Forwarder = [Forwarder], 
       @Transit_time = [Transit_time], @Shipping_date = [Shipping_date],
       @Shipping_method = [Shipping_method], 
       @Clearance_location = [Clearance_location],   
       @Balance_d = [Balance_due_d], 
       @Balance_t = [Balance_due_t], 
       @Loading_date = [Loading_date]  
   from 
       Inbound 
   where 
       [Pi1] =  @PI
End
GO

Select convert(date, [dbo].[step2-e] ,3);
GO

但是我在选择 Go word 后收到错误消息说:-

But I get error message after Go word on select says:-

错误 SQL70001:在此上下文中无法识别此语句

Error SQL70001: This statement is not recognized in this context

好的,我认为使用 Go word 有问题当我搜索时,我找到了解决方案,但在 asp.net 网站而不是 asp.net 应用程序中.我找到了解决方案 here 但我在 asp.net 应用程序中找不到脚本文件.只是我可以在asp.net网站上找到它.我能做什么?

Ok I think there is problem of use Go word When I searched I found solution but in asp.net website not asp.net application. I found the solution here but I can't find script file in asp.net application. Just I can find it in asp.net website. What can I do ?

推荐答案

在您发布时,SELECT 中的前两个元素之间缺少一个逗号:

As you posted it, there's a comma missing between the first two elements in your SELECT:

select 
    @Advance_payment = [advance_payment] @Balance = [Balance], 
                                       ^^^^
                                        | 
                                      here there should be a comma!

所以试试这个:

select 
   @Advance_payment = [advance_payment],
   @Balance = [Balance], 
   ..... (rest of your statement) ....

这篇关于错误 SQL70001:在此上下文中无法识别此语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆