Select * without returning all columns - Coldfusion / SQL Server 2008

I am getting strange behavior related to database queries that I have never seen before, and I hope you can highlight the problem.

I have a data table called myTable with some columns; so far, everything connected with this has been wonderful. Now I just added a column called subTitle; and II notice that the query SELECT *that retrieves the data for this record does not know about this column (it says the returned query does not have a subTitle column), but if I explicitly name the column (select subTitle), is. I thought it might be that the Coldfusion server could cache the request, so I tried working with cachedwithin="#CreateTimeSpan(0, 0, 0, 0)#", but not with cubes.

Consider the code below:


<cfquery name="getSub" datasource="#Application.datasourceName#">
     SELECT   subTitle 
     FROM     myTable
     WHERE    RecordID = '674'
 </cfquery> 

 <cfoutput>#getSub.subTitle#</cfoutput>

 <cfquery name="getInfo" datasource="#Application.datasourceName#">
     SELECT   * 
     FROM     myTable
     WHERE    RecordID = '674'
 </cfquery>  

 <cfoutput>#getInfo.subTitle#</cfoutput>

, 674 "test" subTitle, ,

[[CRASH WITH ERROR]]

, SQL Server 2008 - SELECT * , , SQL Management Studio, select *

, ; , , select , * ( ​​ ), , .

SQL Server 2005 , , , SQL Server 2008 - ; , , .

=== UPDATE ===

CF- .

+3
2

, ColdFusion <cfquery> SQL. , , .

:

  • :
    • , moniter . ( @Dpolehonski, )
    • Clear Template Cache Now ColdFusion ( /).
      CFML- , CF , .
  • :
    SQL, , -. , .
    .
    ( , , .)
  • :
    ColdFusion. , .
+8

:

<cfquery name="getInfo" datasource="#Application.datasourceName#">
   SELECT 
     *, #createUUID()# as starQueryCacheFix
   FROM 
     myTable
   WHERE 
   RecordID = '674'
 </cfquery>

... ColdFusion. , ;)

+2

All Articles