Coldfusion and MS SQL
Hello community, a client of mine just moved their database from Pervasive to MS SQL. I created an intranet that was accessing the Pervasive database with no problems.
The problem I have is something weird that is happening when querying the new database.
In one particular table the name a column for description "DESC", which is a MS SQL keyword. I'm able to retrieve the data from it if I use quotation marks.
<cfquery datasource="test" name="equipo">
SELECT "DESC"
FROM ICITEM
</cfquery>
So far so good.
Now, if I want to retrieve another column called ITEMNO my query looks like this:
<cfquery datasource="test" name="equipo">
SELECT ITEMNO, "DESC"
FROM ICITEM
</cfquery>
It also works.
However, when I try to get a different column called FMTITEMNO, which exists, i get an error using this query:
<cfquery datasource="test" name="equipo">
SELECT FMTITEMNO, "DESC"
FROM ICITEM
</cfquery>
Error:

If I try just that column alone, without the "DESC" column, it works:
<cfquery datasource="test" name="equipo">
SELECT FMTITEMNO
FROM ICITEM
</cfquery>
This is my first time working with MS SQL and I think it could be something related to the syntax.
If someone understands what could be happening it would be a great help.
Thank you so much!
