If you ever experience this while using NHibernate, just do the following:
1. Open the mappings file, in my case User.hbm.xml and go to the following line of code
<class name="Model.UserEntity, Model" table="User">
The SQL generated for this class is
SELECT this_.GUID as GUID8_0_, this_.IsDisabled as IsDisabled8_0_, this_.LoginName as LoginName8_0_, this_.Name as Name8_0_ FROM User this_
2. Change the table that the class is mapped to, to the following
<class name="Bookstore.Model.UserEntity, Bookstore.Model" table="[User]">
The new SQL will look something like this
SELECT this_.GUID as GUID8_0_, this_.IsDisabled as IsDisabled8_0_, this_.LoginName as LoginName8_0_, this_.Name as Name8_0_ FROM [User] this_
The reason for this is, User is a reserved word in SQL Server. Escape it with hard brackets, [ ]. User is the name of a security function that returns the current user's database username in SQL. Typically it will return 'dbo'.