Incorrect Syntax near the keyword 'IN'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • waiza
    New Member
    • May 2012
    • 1

    Incorrect Syntax near the keyword 'IN'

    Code:
    CREATE PROCEDURE InsertStudent(In p1 nvarchar(50),In p2 nvarchar(50),In p3 nvarchar(50),In p4 nvarchar(50))
    
    AS
    
    BEGIN
    INSERT INTO STUDENT(roll,dob,phone,address) values(p1,p2,p3,p4)
    END
  • PsychoCoder
    Recognized Expert Contributor
    • Jul 2010
    • 465

    #2
    I don't see the word In being used in this procedure. Are you sure it's this proc that's erroring on you?

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      Get rid of the IN keyword in your parameter list.

      Comment

      • India777
        New Member
        • Apr 2012
        • 61

        #4
        Code:
        CREATE PROCEDURE ProcedureName
        @var1 nvarchar(50),
        @var2 nvarchar(50)
        AS
        BEGIN
            ................write insert query here................
        END

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32636

          #5
          Procedure parameters are not declared with an "IN" keyword. You may be confusing this with the "OUT" | "OUTPUT" keyword which is sometimes used in parameter declarations. See MSDN: CREATE PROCEDURE (Transact-SQL) for the full SP.

          Comment

          Working...