Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9126803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:07:47+00:00 2026-06-17T07:07:47+00:00

I am altering a stored procedure, and when I try to excecute, I get:

  • 0

I am altering a stored procedure, and when I try to excecute, I get:

Msg 156, Level 15, State 1, Procedure vtg_asmbltimephasedashassy, Line 20  
Incorrect syntax near the keyword 'AS'   

But when I go to line 20, there is no keyword ‘as’, nor is it in the line directly before or after line 20. Maybe I am counting the lines wrong.

When I am counting to line 20 I get the line that reads

jobmtl.partnum=partwhse.partnum FULL OUTER JOIN  

Could anyone point me in the right direction as what I need to do to resolve the issue? My enitre stored procedure follows below.

USE [mfgsys803]
GO
/****** Object:  StoredProcedure [dbo].[vtg_asmbltimephasedashassy]    Script Date:   01/08/2013 12:59:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER proc [dbo].[vtg_asmbltimephasedashassy] @p_plant varchar(max) 
as 
begin 
set nocount on;

SELECT     jobhead.jobnum, sum(partwhse.onhandqty) as 'onhandqty', jobhead.partnum, jobhead.revisionnum, jobhead.prodqty, jobhead.startdate, jobhead.duedate, jobhead.reqduedate, 
                  jobhead.commenttext, jobmtl.issuedcomplete, jobmtl.issuedqty, jobmtl.mtlseq, jobmtl.partnum AS 'mtlpart', jobmtl.requiredqty, jobmtl.qtyper, jobmtl.reqdate, 
                  partwhse.warehousecode, prodgrup.description
FROM         jobmtl LEFT OUTER JOIN
                  partwhse INNER JOIN
                  warehse ON partwhse.company = warehse.company AND partwhse.warehousecode = warehse.warehousecode ON jobmtl.company = partwhse.company AND 
                  jobmtl.partnum = partwhse.partnum FULL OUTER JOIN
                  prodgrup INNER JOIN
                  jobhead ON prodgrup.company = jobhead.company AND prodgrup.prodcode = jobhead.prodcode ON jobmtl.company = jobhead.company AND 
                  jobmtl.jobnum = jobhead.jobnum
WHERE     (jobhead.jobreleased = 0) AND (jobhead.jobfirm = 1) AND (jobhead.jobengineered = 1) AND (jobhead.company = 'lot') and  (prodgrup.description like '%assy%') and (jobhead.plant=@p_plant) and (warehse.plant=@p_plant)

group by     jobhead.jobnum, jobhead.partnum, jobhead.revisionnum, jobhead.prodqty, jobhead.startdate, jobhead.duedate, jobhead.reqduedate, 
                  jobhead.commenttext, jobmtl.issuedcomplete, jobmtl.issuedqty, jobmtl.mtlseq, jobmtl.partnum AS 'mtlpart', jobmtl.requiredqty, jobmtl.qtyper, jobmtl.reqdate, 
                  partwhse.warehousecode, prodgrup.description


end 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:07:49+00:00Added an answer on June 17, 2026 at 7:07 am

    take this part out of the group by

    jobmtl.partnum AS 'mtlpart'
    

    make it

    jobmtl.partnum 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came across an interesting problem today. I was altering a stored procedure and
I'm trying to change what the stored procedure returns without altering data. I'm trying
I am calling an 2005 MS SQL Server stored procedure using the MS JDBC
I am working on an Oracle sql database. I have a stored procedure where
I need mysql script (not a stored procedure) that check whether column exist or
I am currently working on a project, which involves altering data stored in a
I need help altering this Perl code. I can get a list of all
I have a stored procedure that returns about 50000 records in 10sec using at
I have the following stored procedure: proc_main:begin declare done tinyint unsigned default 0; declare
We've a stored procedure that happens to build up some dynamic SQL and execute

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.