Sometimes you need words to make identification of your columns easier and 
unfortunately, some of these words may be reserved words. However, you could 
put such words in square brackets and use them as column names 

so you could put such as [Order] instead of just 'Order'

----- Original Message -----
From: "Khalil KHAMLICHI" <[email protected]>
To: [email protected]
Sent: Wednesday, April 18, 2012 12:12:53 PM
Subject: [web2py] Error with mssql database : Field is a reserved SQL word


Hi, 


I am trying to create an interface to sort of manage the database of a windows 
software (a very common need actually), this database is under Microsoft SQL 
Server 2008 Express Edition, and one of its mean tables has a field called 
'Order' which is a reserved word in SQL language, and using this database is 
just impossible from web2py because of this field name. 


whenever I try to use this table I ge this error : 





127.0.0.1.2012-04-18.11-58-36.d24a6ea4-8275-4626-8d72-f464db6b9e24 
<class 'pyodbc.ProgrammingError'> ('42000', "[42000] [Microsoft][ODBC SQL 
Server Driver][SQL Server]Incorrect syntax near the keyword 'Order'. (156) 
(SQLExecDirectW)") 


I think this question shoud go to pyodbc mailing list ... but I thought maybe 
someone over here has any suggestions. 


Thanks in advance. 

Reply via email to