Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Posts
    7

    Unanswered: Reserved words as column names

    Hi there,

    I'm trying to recreate a MS-SQL database in MySQL. One particular table has a column names "Precision", a reserved word in MySQL. I woudl really prefer to keep this name if possible as it will be referenced in all sorts of places. I've tried single and double quotes, that didn't work.

    Is it possible to use reserveds word as column names? How?

    cheers

  2. #2
    Join Date
    Nov 2006
    Location
    Quebec
    Posts
    172
    Use brackets [] like this [Precision]
    eg:
    SELECT [Precision], * FROM youreTable
    Less is more.
    How long is now?
    http://www.lesouterrain.com

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    ortho, that doesn't work in mysql

    the identifier delimiter in mysql is the `backtick`
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Nov 2006
    Location
    Quebec
    Posts
    172
    oops my bad tought I was in the MSSQL forum
    Less is more.
    How long is now?
    http://www.lesouterrain.com

  5. #5
    Join Date
    Nov 2006
    Location
    Quebec
    Posts
    172
    so yeah do it like this
    `Precision`
    Less is more.
    How long is now?
    http://www.lesouterrain.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •