>
> CFMX 6.1 on Win 2000. I am running the dev app off a SQL Server 2000.
> Everytime I make a change in database design on a particular table
> (say add a column), I keep getting an error on the front-end of the
> app. The error seems to occur when it encounters a query of that table
> in combination with two other tables. The error says "Variable cannot
> be converted to requested type" and throws out the line where it
> encountered the error. This line refers to the identity column of this
> offending table.
>
> <cfif FormID>AND ep.FormID = <cfqueryparam cfsqltype="cf_sql_smallint"
> value="#FormID#"></cfif>
When you use cfqueryparam, the database can 'compile' and cache
the query plan and then at runtime substitute the right
parameters into the precompiled plan. If you change the database
schema the cache of compiled query plans should be flushed and
recompiled, but apparently the database doesn't do that
automatically.
I don't know enough about the specifics of execution plan caching
in MS SQL Server to tell you how to force the execution plan to
be flushed, but this seems to be the cause of your errors.
Jochem
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]