• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

INFORMATION_SCHEMA.Columns

New Here ,
Jun 05, 2013 Jun 05, 2013

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!

TOPICS
Advanced techniques

Views

490

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 11, 2013 Jun 11, 2013

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation