Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9019045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:40:55+00:00 2026-06-16T04:40:55+00:00

My stored procedure won’t work, I get an error : Msg 102, Level 15,

  • 0

My stored procedure won’t work, I get an error :

Msg 102, Level 15, State 1, Procedure SP_HUGO_INSRTGAME, Line 4
Incorrect syntax near ‘@firstName’.
Msg 137, Level 15, State 1, Procedure SP_HUGO_INSRTGAME, Line 12
Must declare the scalar variable “@StudentFirstName”.
Msg 102, Level 15, State 1, Procedure SP_HUGO_INSRTGAME, Line 13
Incorrect syntax near ‘value’.

Here’s my stored procedure:

Create Procedure SP_HUGO_INSRTGAME 
(
@lastName as nvarchar(200)
@firstName as nvarchar(200)
@email as nvarchar(200)
@StudentFirstName INT

)
As
Begin

    SET @StudentFirstName =  'insert into tbl_hugo_user (user_email, first_name, last_name, confidence, inspire, creativity, bonus_q )  values (@email, @firstName, @lastName, 0, 0, 0, 0); SELECT SCOPE_IDENTITY() ';
    insert into tbl_hugo_game (user_hugo_Id) value (@StudentFirstName )
End
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:40:56+00:00Added an answer on June 16, 2026 at 4:40 am

    You have lots of errors in the procedure:
    First: when defining the parameters there has to be a comma after every parameter
    Second: You are just setting the @StudentFirstName the string value but it is an int. From the string I get that you are first inserting the row and then getting the ID of that recently inserted row to the @StudentFirstName. For that you have to do something like this:

    insert into tbl_hugo_user (user_email, first_name, last_name, confidence, inspire, creativity, bonus_q ) values (@email, @firstName, @lastName, 0, 0, 0, 0)

    SELECT @StudentFirstName = SCOPE_IDENTITY()

    using that you will get the id and then you can do

    insert into tbl_hugo_game (user_hugo_Id) values (@StudentFirstName )
    to finish off.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a stored procedure to work for a co-worker who is
I have the following stored procedure that I have to get data from: EXECUTE
What's the syntax for creating a stored procedure that contains two queries, if the
i've got this stored procudure that won't work. If I try this query in
I'm implementing stored procedure that won't have transactions inside. Actually, it will, but only
I'm trying to get a output parameter from MySQL stored procedure, let's have look
I would like to call an update stored procedure which won't necessarily include all
Does passing SQL Parameters to a stored procedure alone ensure that SQL injection won't
my stored procedure is like below, select T.TranNo,(Select Accountname from Accountable where AccountCode =T.tranAccountCode)
This stored procedure is supposed to : Take the userid and Date as input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.