Trying to use the same stored procedure to update selected fields in a record could overwrite remaining pre-existing field values if empty string parameters are passed.
To solve this problem, I use the following cf code and T-SQL code when updating fields:
cf code:
<cfprocparam type="In" dbvarname="field1" value="." cfsqltype="CF_SQL_VARCHAR"> indicates that the current value is to be kept,
<cfprocparam type="In" dbvarname="field1" value="" cfsqltype="CF_SQL_VARCHAR"> indicates that the value is to be nulled
T-SQL code:
fld1_txt = nullif(coalesce(Nullif(@field1,'.'), fld1_txt),'')

I've tested this last statement in Query Analyzer and it works as required.

Rick Bierregaard
Web Developer
Boeing CAS
[EMAIL PROTECTED]
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to