I'm having trouble getting PDO prepared statements to work with SQL Server's non-traditional data types such as money
. The database assumes the field is nvarchar
even if it's cast as a float, and returns an error like:
Error converting data type nvarchar to money.
I'm used to MySQL and things "just working" so I'm a little lost.
$stmt = $pdo->prepare('EXEC my_money_sp ?');
$stmt->bindValue(1, 10.00);
$stmt->execute();
// SQLSTATE[42000]: [SQL Server]Error converting data type nvarchar to money.