in reply to Re^7: Issue while inserting Thai Characters into Database..
in thread Issue while inserting Thai Characters into Database..

I tried several options with timestamp. But i got "MicrosoftODBC SQL Server DriverInvalid precision value (SQL-HY104)" error message.
But below code with date and no timestamp is working fine without any issues.
my $sql= "INSERT INTO BK_imageINfo (BusDate) VALUES (?)"; . my $bdate = "2010-01-20"; $sth->execute("{d '$bdate'}");
Through my script, now i am able to insert date as well as Thai Characters to SQL Server database without any issues...

Thanks much for your extensive support Martin.

Thanks,
Ajay

Replies are listed 'Best First'.
Re^9: Issue while inserting Thai Characters into Database..
by mje (Curate) on Jan 22, 2010 at 09:44 UTC

    I now realise you probably mean an actual timestamp column as opposed to a datetime column - yes? timestamp columns are special in SQL Server and you generally cannot insert into them but you can set a DEFAULT on the column to get the current time. If you have a column of type timestamp you should not be inserting into it - if you need to then make it a datetime instead and use the ODBC "ts" syntax.

      Sorry for the confusion Martin. Actually it is datetime datatype in SQL Server and i tried inserting a value "2010-01-22 12:00:00 AM" as execute("ts '$bdate'"); but i ended out with Precision error.

        The "AM" is not valid syntax - omit it.