SQL error: Incorrect syntax near the keyword 'User'
User
is a reserved keyword, so you must use square brackets to make it explicit that you mean the object named "User" it, i.e. use [User]
instead of User
.
SQL Error: Incorrect Syntax near the keyword User
Why are you using double quotes at all? I would start with:
SELECT u.Disabled, u.UserName
FROM Database.dbo.User u
ORDER BY u.UserName ASC
You don't specify your database, but words like User
are often reserved words, so they make a poor choice for an identifier name.
Incorrect syntax near the keyword 'User'. error on SQL Server
User
is a reserved word and needs to be escaped, commonly by using square brackets e.g.
SELECT * FROM dbo.[User]
But double quotes also work:
SELECT * FROM dbo."User"
Although it will make your life (and any developers who follow) a lot easier if you just avoid using reserved words.
c# incorrect syntax near the keyword 'user'
user
is a reserve word and thus needs escaping like insert into [user] values...
Or insert into "user" values...
Incorrect syntax near the keyword 'user'- How to write my query - VB.net and Sql Server
Try this
SELECT NAME, EMAIL, PASSWORD FROM [USER]
WHERE ID =(SELECT USERID FROM EMPLOYERUSER WHERE EMPUSERTYPE=1 AND EMPLOYERID= 96)
This is because you have used keyword USER
Related Topics
Add the Where Clause Dynamically in Entity Framework
Getting @@Identity from Tableadapter
Writing File to Web Server - ASP.NET
Finding the Concrete Type Behind an Interface Instance
String.Format() Giving "Input String Is Not in Correct Format"
How to Ensure Entries with Non-Overlapping Time Ranges
Register Iauthenticationmanager with Simple Injector
Compile for Windows on Linux Using Monodevelop
How to Get Float Value with SQLdatareader
How to Target Mono Framework from Vs2015
Wcf Service Attribute to Log Method Calls and Exceptions
C# - Elegant Way of Partitioning a List
Linq to Entities Generated SQL
Download a File from Azure Devops Server Writes Wrong Data to The File
Windows Form Application Exception