I have just found the following thread...
http://www.knowmysize.com/blog/index.cfm?c=SQL&mode=cat&catid=13C03BEC-7
E9C-B5BD-B8DC464AF6CB114D&dv=bycat

--------------

I have just experienced an issue with CF7/SQL Server with CFQUERYPARAM
with a SQL error.  I attempted to use the sql type of cf_sql_bit and CF
informed me that string or binary data would be truncated.  I realized
my field was defined incorrectly as char(10) vs a bit field so I
addressed the issue at the database and tried my test again only to see
the same message.  

It appears that CF7 or more likely SQL server is caching the bind
parameters created with CFQUERYPARAM so despite my change, I was unable
to get the query working.

Here are some suggestions to fix the issue

Change the sqltype temporarily forcing CF to recognize the change in the
query 
Add a mystery field to the query to achieve the same thing and then
delete it once you see the new error. 
Restart CF (my machine takes over a minute to cycle CF) 
Uncheck maintain DB connections in the admin and call another query.
Then go back and check it again.

-------------

This is a bit over my head - could it be relevant? I am using cfmx6.1

-----Original Message-----
From: Steve Bryant [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 15 November 2005 8:59 a.m.
To: CF-Talk
Subject: Re: Truncated error 


Mike,

I wouldn't trust the line number of the error. In my experience,
ColdFusion often reports a line number equal to one or two lines above
</cfquery>.

ColdFusion just compiles some SQL and sends it to SQL Server. Since SQL
Server doesn't specify which field is causing the problem, ColdFusion
doesn't know either.

Short answer, check your other fields for problems as well.

You might try using the maxlength attribute of cfqueryparam.

<plug>
I have a free (and open source) DataMgr component that makes inserts and
updates easier (less code, among other things). It also tells you which
field is too long in the error. http://www.bryantwebconsulting.com/cfcs/

A version coming out (hopefully) this week will also optionally allow
you to truncate incoming data to the length of the database field to
avoid those errors.

It currently supports MS SQL Server, MS Access, MySQL, PostGreSQL. Very
easy to add others. </plug>

Hope that helps!

Steve Bryant.
Bryant Web Consulting LLC
http://www.BryantWebConsulting.com/
http://steve.coldfusionjournal.com/ 

>The error I am getting is...
>
>[Macromedia][SQLServer JDBC Driver][SQLServer]String or binary data 
>would be truncated. It is highlighting
>
><cfqueryparam cfsqltype="cf_sql_bit" value="#arguments.updates#"> ??



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:224141
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to