Skip to main content
Known Participant
April 20, 2008
Question

Missing Field in Query

  • April 20, 2008
  • 3 replies
  • 881 views
I'm hoping I'm just doing something very stupid. I have CF8.01 and SQL Server 2005. I have a simple table for which I recently added a column, with the default value of NULL. When I do a query of all fields from within SQL Management Studio the results include all fields, including the latest column. There are no errors in SQL Server when I add the column or manually add data.

In CF 8 however, a <cfquery> for all fields in that table fails to find the new column - I've used CFDump to verify. The field simply doesn't show up. The query is not cached. No errors are returned to CF. This should have been a relatively easy update to my project, but it's turned into a real stumper.

Any ideas or suggestions? Thanks in advance!

This topic has been closed for replies.

3 replies

Inspiring
April 20, 2008
Getting back to your original question about doing something stupid, if this were my problem, a likely cause would be a development/production database mixup.

But it's not. If the insert doesn't work, try dropping and recreating the datasource.
Known Participant
April 21, 2008
Dan - sorry, don't know where john came from!

I restarted SQL Server and then CF recognized all fields. So i am still not certain what was going on, but that did the trick. Thanks for the the assistance!
Inspiring
April 20, 2008
The first thing I would try is
select newfield
from yourtable
where 1 = 2
Known Participant
April 20, 2008
John and Jim,

Thanks for the suggestions. I have not tried inserting a record via CF yet and will do. As for a test select, I did try that and it simply does not see the new field. The error is that I'm requesting an invalid table field... Very strange.
Inspiring
April 20, 2008
Just a suggestion: Write a quick insert query to write a record to that table, including a value for the new column. If there are any caching issues they should disappear when you try to read the table again. If you get a CF error it may pinpoint the problem.