Hello Friend..
Your Syntax near declaration part is wrong, that's why you got this error..
you have to declare a parameter in store procedure but when you want to declare more then one parameter at that time you have to saprate it with "," (comma) so its a right syntax to declare a parameter in store procedure.
like this ..
@ID INT
@ID INT,
@FirstName NVARCHAR(20),
@LastName NVARCHAR(20)
But also not that when we declare a parameter and its more then one then at that time we have to apply "," but at that time it also care that at the last parameter you need not to put the "," like in above example i will put comma at @ID and @FirsName but not at @LastName
so tack care for it..
and in you procedure you have to put comma at @Year parameter so your error will be solved like this...
CREATE PROCEDURE GetAllCoursesAndCategories
@Year varchar(128),
@CourseCatID int
and for more information on store procedure please refer this links..
Overview of SQL Server Stored Procedure[
^]
http://msdn.microsoft.com/en-us/library/aa258259%28v=sql.80%29.aspx[
^]
http://msdn.microsoft.com/en-us/library/ms345415.aspx[
^]