[SqlException: Line 1: Incorrect syntax near '.'.]

R

Roger R. Smith

I see this error in my ASP .NET code:

[SqlException: Line 1: Incorrect syntax near '.'.]

I am trying to execute the following:
private const string SQL_SELECT_USER = "SELECT User.Email, User.FirstName,
User.LastName, User.Status, User.Phone, User.Privs FROM User INNER JOIN
Login ON User.UserId = Login.UserId WHERE Login.UserId = @UserId AND
Login.Password = @Password";



Any ideas here?

Thanks

Rog
 
U

Uwe Hafner

"User" is a reserved keyword on SQLServer

Use Brackets "[]" like [User] instead of User.

hth
Uwe
 
R

Roger R. Smith

Thank you very much Uwe. That was it!
thank you for taking the time to help me.
Rog


Uwe Hafner said:
"User" is a reserved keyword on SQLServer

Use Brackets "[]" like [User] instead of User.

hth
Uwe


Roger R. Smith said:
I see this error in my ASP .NET code:

[SqlException: Line 1: Incorrect syntax near '.'.]

I am trying to execute the following:
private const string SQL_SELECT_USER = "SELECT User.Email, User.FirstName,
User.LastName, User.Status, User.Phone, User.Privs FROM User INNER JOIN
Login ON User.UserId = Login.UserId WHERE Login.UserId = @UserId AND
Login.Password = @Password";



Any ideas here?

Thanks

Rog
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top