Copy link to clipboard
Copied
i have the following query that worked just fine on CF7 and SQL server 2000
<cfquery name="getColumns" datasource="ds">
SELECT Column_Name, Data_Type
FROM INFORMATION_SCHEMA.Columns
WHERE Table_Name = 'Fields'
AND Table_Catalog = 'databasename'
</cfquery>
now that have upgraded to CF 9 and SQL 2012 - this query does not work
"
Error Executing Database Query. | |
[Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near the keyword 'FROM'. |
Any ideas - trying to export from SQL database to an excel file - THANKS!
Copy link to clipboard
Copied
What happens if you change the query to SELECT * FROM COLUMNS ... ??? If that works then you might need to put brackets around those column names. They don't look exactly like SQL reserved words, but ...
-reed