Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Sql server keyword 'user'

 
Alana Sparx
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, i know that strictly speaking this isn't JDBC, but it could be!

The following sql statement fails in Sql Server:

because the table name 'user' is a keyword. How can I retrieve the data from this table?


don't work!

NB, Some other clown designed the schema.

Many thanx
 
Alana Sparx
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah! Bless the advent of the square bracket, a la


toodle-pip.
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alana Sparx:
Ah! Bless the advent of the square bracket, a la


toodle-pip.


On at least many other databases, "USER" would have worked; on some databases, the quotes make the column name case-sensitive, where it normally is not.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!