what is wrong with this query ?

已答复 what is wrong with this query ?

  • 2012年7月6日 15:02
     
     

    insert into user values(@user_firstname,@user_lastname,@user_email,@user_mo_no)

    it gives me error that ....Incorrect syntax near the keyword 'user'.

全部回复

  • 2012年7月6日 15:06
     
     已答复 包含代码

    Hi,

    "user" is a reserved keyword.

    Tryinstead:

     
    insert into [user](...)
    

    • 已标记为答案 .netaholic 2012年7月6日 15:10
    •  
  • 2012年7月6日 15:06
     
     

    You need to specify the columns you are inserting into first.  i.e.

    INSERT INTO User (user_firstName,user_LastName,user_email) Values (@user_firstname,@user_lastname,@user_email)

  • 2012年7月6日 15:09
     
     已答复

    ok...user is the keyword in sql server...

    • 已标记为答案 .netaholic 2012年7月6日 15:09
    •