Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error SQL70001: This statement is not recognized in this context

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 ?

like image 680
user3623037 Avatar asked May 10 '14 10:05

user3623037


Video Answer


2 Answers

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

like image 182
Gabriel Marius Popescu Avatar answered Oct 05 '22 18:10

Gabriel Marius Popescu


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) .... 
like image 40
marc_s Avatar answered Oct 05 '22 19:10

marc_s