Click here to Skip to main content
15,900,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello programmer, need a helping hand here. Im getting an error here saying
Msg 102, Level 15, State 1, Procedure GetByYearDisciplineCourseCatWithDepartment, Line 12
Incorrect syntax near '@DisciplineID'.

When I create a stored procedure. Is there any wrong here in my codes?
SQL
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE GetByYearDisciplineCourseCatWithDepartment
@Year varchar(128),
@DisciplineID int
AS
BEGIN
    SELECT CC.CourseCatName, CC.CourseCatID
    FROM  DisciplineCourseCat DCC
       INNER JOIN CourseCategory CC ON
          DCC.CourseCatID = DCC.CourseCatID
WHERE DCC.[Year] = @Year And
      DCC.[DisciplineID] = @DisciplineID
GO


Thanks and more power
Posted

1 solution

You missed "END" at the end of procedure.
 
Share this answer
 
v2
Comments
janwel 2-Nov-11 21:52pm    
Forgot that syntax. Thanks ^_^
Bun Leap_kh 2-Nov-11 21:53pm    
You're welcome ^_^

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900