larrylapointe
IS-IT--Management
I am writing a PHP script to automatically import data from a text file into an MS SQL database. Unfortunately when I try to run execute the SQL Insert statment the server seems to be converting a numeric value into a varchar field...
Here are the lines in php:
$Query = "Insert into Table (PartyId,Code,Date,Type) VALUES (101,'A1','9-Mar-2003 00:00:00','CASH')";
$Result = mssql_query($Query);
(Note PartyId is a numeric field, while all others are varchar.)
Here is the message that is returned:
Warning: mssql_query() [function.mssql-query]: message: Error converting data type varchar to numeric. (severity 16) in C:file.php
It appears that the number 101 is being converted to a varchar ???
BTW: I am running php 4.3.1 on an Apache2 server under Win2000. The SQL Server is MSSQL Server 2000.
Ideas???