I came across a scary sql non-error. Thought I'd share.  It can be convenient to toss 
multiple insert statements into one cfquery.  Consider the below code where the field 
'Description' is varchar(10):

<cfquery datasource="#application.Datasource#">
INSERT INTO Table (Code, Description) VALUES ('a', 'yo')
INSERT INTO Table (Code, Description) VALUES ('b', 'this string is too long')
INSERT INTO Table (Code, Description) VALUES ('c', 'yo')
</cfquery>

This will not throw an error. (I am using CF 4.5/SQL Server 2K)

If you did the second statement first, it will throw a sql data truncation error.  In 
the above case, it will insert the first and third row, but not the second.

If you do 3 separate <cfquery>s, then of course, the second would throw an error.

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to