Forums

This topic is locked

Data Insert Into MS SQL Incorrect

Posted 30 May 2003 04:59:29
1
has voted
30 May 2003 04:59:29 Ken Sinlao posted:
Using DWMX Coldfusion w/MS SQL. The problem I'm experiencing is with MS SQL. I have an Insert form with (2) drop down list that submits to the same database column. The problem is when it inserts, MS SQL puts a comma after the first drop down list data that's inputted. With the comma my recordset will not work. Is there any way to input the data into MS SQL without it adding that comma? Thanks.

Replies

Replied 30 May 2003 10:54:19
30 May 2003 10:54:19 Lee Diggins replied:
Hi

I know nothing about Coldfusion but i do know you can do this with SQL:

insert into tbl_fruit(myColumn) values (Replace('apple, orange',',',''))

This then strips out the comma, hopefully it'll get you going in the right direction. You may find it better to strip out the on the processing page before your insert statement, so you'll need to utilise a similar function in your scripting language and then pass that value to the SQL statement. You could also write a trigger on the SQL table to strip out the commas in the required column and set it for INSERT and UPDATE.

Digga

Sharing Knowledge Saves Valuable Time!!!

Reply to this topic