Click here to Skip to main content
15,305,625 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My database was running fine ,I made no changes to it and all of a sudden it started giving me errors in insert query such as
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '<'.
OR varchar is not recognized as build in function. This is what I get when I run a default query OR even when I create a new table , it just not work , do I need to install something ? Please help!
IT WAS WORKING FINE A FEW DAYS BACK
I HAVE ALSO INSTALL NEW VERSION OF DATABASE MAY BE THAT IS THE ISSUE?


USE [CMS]
GO

INSERT INTO [dbo].[userRegistration]
           ([userName]
           ,[userEmail]
           ,[userPassword]
           ,[userDesignation]
           ,[userPhone])
     VALUES
ERRORS start from this part. 
           (<userName, varchar(50),>
           ,<userEmail, varchar(50),>
           ,<userPassword, varchar(50),>
           ,<userDesignation, varchar(50),>
           ,<userPhone, varchar(50),>)
GO


What I have tried:

I have done a lot of research but all of the articles advise to fix the query, do note that this is a default MS sql server query I DID NOT WRITE THIS
Posted
Updated 1-May-21 19:34pm
Comments
David Crow 1-May-21 23:42pm
   
I'm guessing there are mismatched angle brackets.

1 solution

Simple: get rid of the '<' and '>' characters and the datatypes:
SQL
INSERT INTO [dbo].[userRegistration]
           ([userName]
           ,[userEmail]
           ,[userPassword]
           ,[userDesignation]
           ,[userPhone])
     VALUES
           (valueForName
           ,valueForEmail
           ,valueForPassword
           ,valueForDesignation
           ,valueForPhone)

And do yourself a favour ... Never store passwords in clear text - it is a major security risk. There is some information on how to do it here: Password Storage: How to do it.[^]

And remember: if you have any European Union users then GDPR applies and that means you need to handle passwords as sensitive data and store them in a safe and secure manner. Text is neither of those and the fines can be .... um ... outstanding. In December 2018 a German company received a relatively low fine of €20,000 for just that.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900