Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    10

    Unanswered: Stored Procedure 'Incorrect Syntax Near' Error

    HI

    i keep getting the following error in Query Analyzer
    Server Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near '824'


    Code on SQL 2K:
    CREATE PROCEDURE sp_acceptInputs
    (@serverType varchar(10), @rNumList varchar(2000) )
    AS
    DECLARE @errNumber int,
    @mailingList varchar(8000),
    @errMsg varchar(255)

    --executable statements earlier, now all commented out
    GO

    The rNumList is a list of ids that i plan to accept in string form and convert to ints for database fetch.

    i had some processing logic in there. Since i got the below syntax error, i COMMENTED OUT ALL THE EXECUTABLE statements, but continue to get the error.

    Sample I/Ps tried out from QueryAnalyzer:

    1) exec sp_acceptInputs "DW" "824;825"
    2) exec sp_acceptInputs "DW" "824"
    3) exec sp_acceptInputs "DW" 824


    No matter what i try as the second parameter, i keep getting the following error in Query Analyzer. i tried changing the 2nd parameter from varchar to int, but to no avail.

    Server Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near '824'

    Could you please let me know where i am going wrong ?

    Regards
    Babbu

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    try this :
    exec sp_acceptInputs "DW","824;825"

  3. #3
    Join Date
    Sep 2003
    Posts
    10
    Hi

    Thank you so much for your prompt reply. The procedure is now up and running....

    Regards
    Babbu

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •