質問

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

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

Error SQL70001: This statement is not recognized in this context

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 ?

役に立ちましたか?

解決 2

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!

So try this instead:

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

他のヒント

This error is due to the fact that Build Action is set To Build inside the Properties. Set it to None and it should work fine. enter image description here

Comma missing from various places. After output in variables declaration:-

@Advance_payment varchar(50) output

@Loading_date date output

And in the select statement after [advance_payment]:

@Advance_payment = [advance_payment]

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top