Hi I am trying to create a stored procedure but each time I try to save it I get an error
Msg 102, Level 15, State 1, Procedure forum_Insert_Post, Line 3
Incorrect syntax near '@description'.
Msg 137, Level 15, State 2, Procedure forum_Insert_Post, Line 9
Must declare the scalar variable "@title"
This is my code:
CREATE PROCEDURE forum_Insert_Post
@title nvarchar
@description nvarchar
@subcategoryId int
@date dateTime
@usernameId uniqueidentifier
AS
INSERT INTO forum_posts (PostTitle , PostContent , PostDate , UserId , SubcategoryId)
VALUES (@title , @description , @date , @usernameId , @subcategoryId)
What am I doing wrong here?
You need commas after the parameters: