View Single Post
  #5 (permalink)  
Old December 23rd, 2005, 08:30 AM
mmcdonal mmcdonal is offline
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

Sorry, when I say typed, I mean that the script sets teh variable type as either a number of a string. With zip fields it will want a number if it is not typed. It just guesses it to be a number field, which means it will carry out any arithmetic instructions in the variable, so 00210-4230 = -4020.

If you force the type to string at read time, then your script doesn't have to guess the variable type and will take text and numbers, and not apply any arithmetic.

If your SQL server is looking for numbers and sees an arithmetic expression coming in, it may have problems. If it sees a text variable from your script trying to go into a number field, it will reject it. If it sees a string going into a string field of the proper length, it will accept it.


Reply With Quote