0

I am trying to create a stored procedure to store data input from web forms to a SQL Server table. I can get the select statement for first_name to work correctly, but when I try add more Insert statements, I get a syntax error.

What am I doing wrong? Screenshot below. Thanks.

enter image description here

5
  • 1
    Which dbms are you using? (That code is product specific.) Commented Mar 10, 2019 at 20:54
  • 1
    Looks like Microsoft SQL Server, from the use of square brackets. It's common for users of Microsoft SQL Server to call their RDBMS simply "SQL" as if there's no other implementation of the SQL language. I bet if they used a text editor, they'd call it "Word." Commented Mar 10, 2019 at 20:56
  • Microsoft SQL management studio 2017 (sorry i should have specified) Commented Mar 10, 2019 at 20:57
  • 1
    Edit the tags of your question to be more clear. Using tags appropriately helps you get answers from the people who know that product best, because they search for questions posted using that tag. sql-server is the most common tag for Microsoft SQL Server. Commented Mar 10, 2019 at 20:58
  • 1
    You have a comma before the first closing parent. Typo. Commented Mar 10, 2019 at 21:03

1 Answer 1

2

remove the comma , before parantheses.

@email_email varchar(50),
                       ^^^

besides I believe that your insert statement is needed to be like

insert into dbo.users (first_name, last_name, email)
   values (@first_name, @last_name, @email_email)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.