Welcome to the Axosoft Community, Sign in | Register | Help
in Search

Invalid SQL Syntax

Last post 09-17-2007, 11:38 AM by DynoEnviro. 3 replies.
Sort Posts: Previous Next
  •  09-04-2007, 6:49 PM 13057

    Invalid SQL Syntax

    I have a stored procedure called 'spD_DefectsByStateAndSeverity' which is defined as follows:

    CREATE PROCEDURE [dbo].[spD_DefectsByStateAndSeverity]
    (
        @ProjectID int = NULL
    )
    AS
    SELECT * FROM Defects

     When I try to create a custom report and enter the following SQL Command:

    spD_DefectsByStateAndSeverity @ProjectID = 437

    I get an error saying:

    "The SQL statement you entered is invalid."

     I don't understand how this could be invalid.  Any help would be great thanks in advance.
     

     

     

  •  09-05-2007, 1:08 PM 13081 in reply to 13057

    Re: Invalid SQL Syntax

    I have copied the same exact stored procedure from this forum post and tested it on my end. The application did not seem to generate any errors when attempting to create a new custom report. Can you please give me the exact reproduction steps on this issue? Where do you exactly see this error message? Are you running the latest OnTime 2007 version 7.1.2?

     

    Thank you, 


    Dragan Marceta
    www.Axosoft.com
    Filed under:
  •  09-05-2007, 1:13 PM 13083 in reply to 13057

    Re: Invalid SQL Syntax

    Hello nguiffrida,

    I know this might sound basic, but has this stored procedure been created in the correct database?

    If so, make sure you've granted 'execute' permissions to public for that stored procedure.

    Let me know if setting the execute permission to public resolved the issue.


    Thank you,

    Tom Harder
    Axosoft Support
    support@axosoft.com
    1.800.653.0024 option 3
    --'Fear the Bug' Podcast--
  •  09-17-2007, 11:38 AM 13190 in reply to 13057

    Re: Invalid SQL Syntax

    I'm not an SQL expert, but it doesn't look like you're requiring use of the variable that you've declared. Try:

    ...
    AS
    SELECT * FROM Defects
    WHERE [Defects].[ProjectID]=@ProjectID



    Chris
    First rule of leadership...everything is your fault.- Hopper

     

View as RSS news feed in XML

© 2002 - 2007, Axosoft, LLC. All Rights Reserved. | Privacy
Bug Tracking | Defect Tracking Videos | Help Desk Software