Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coldfusion MX

Status
Not open for further replies.

ndolson75

Programmer
Jun 11, 2004
3
US
I am trying to use a <cfquery> to update a record in a MS SQL database. The problem I am having is if a particular column of type varchar is null it will not let me update. the sql looks something like this:
UPDATE myTable SET myField = '#myVar#' where myID = #myID#

if myvar is not '' it works fine, but if it is '' it tells me I must at least include a space. Does anyone know how I could update the record with NULL????
 
thats a little strange, it sounds like the database does not allow nulls for that column. if so, you can simply turn that off..

if turning it off is not an option, you can just set a default with a space:

Code:
<cfparam name="myVar" default=" ">
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top